Skip to content

Commit

Permalink
Merge pull request touchlab#279 from touchlab/jj/kotlin-1.8
Browse files Browse the repository at this point in the history
Updates to support Kotlin 1.8
  • Loading branch information
psh authored Feb 16, 2023
2 parents dfc5cb4 + c1e7d4c commit c502929
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 38 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
}

android {
namespace = "co.touchlab.kampkit.android"
compileSdk = libs.versions.compileSdk.get().toInt()
defaultConfig {
applicationId = "co.touchlab.kampkit"
Expand All @@ -27,7 +28,7 @@ android {
}

lint {
warningsAsErrors = true
warningsAsErrors = false
abortOnError = true
}

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="co.touchlab.kampkit.android">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
16 changes: 8 additions & 8 deletions app/src/main/java/co/touchlab/kampkit/android/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ private val LightColorPalette = lightColors(
primaryVariant = Purple700,
secondary = Teal200

/* Other default colors to override
background = Color.White,
surface = Color.White,
onPrimary = Color.White,
onSecondary = Color.Black,
onBackground = Color.Black,
onSurface = Color.Black,
*/
// Other default colors to override
//
// background = Color.White,
// surface = Color.White,
// onPrimary = Color.White,
// onSecondary = Color.Black,
// onBackground = Color.Black,
// onSurface = Color.Black,
)

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ val Typography = Typography(
fontWeight = FontWeight.Normal,
fontSize = 16.sp
)
/* Other default text styles to override
button = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.W500,
fontSize = 14.sp
),
caption = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 12.sp
)
*/
// Other default text styles to override
//
// button = TextStyle(
// fontFamily = FontFamily.Default,
// fontWeight = FontWeight.W500,
// fontSize = 14.sp
// ),
//
// caption = TextStyle(
// fontFamily = FontFamily.Default,
// fontWeight = FontWeight.Normal,
// fontSize = 12.sp
// )
)
1 change: 1 addition & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
1 change: 1 addition & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ allprojects {
repositories {
google()
mavenCentral()
maven("https://androidx.dev/storage/compose-compiler/repository/")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/")
}
}

Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ kotlin.code.style=official
xcodeproj=./ios
# New memory model
kotlin.native.binary.memoryModel=experimental
#kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.native.cacheKind.iosX64=none
# Ignore the new source-set layout, for now.
kotlin.mpp.androidSourceSetLayoutVersion1.nowarn=true
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[versions]
kotlin = "1.7.20"
kotlin = "1.8.0"

## SDK Versions
minSdk = "21"
targetSdk = "33"
compileSdk = "33"

# Dependencies
android-gradle-plugin = "7.2.2" # Don't bump to 7.3.x until Intellij supports it (unless you're ok with only Android Studio)
ktlint-gradle = "11.0.0"
android-gradle-plugin = "7.4.1"
ktlint-gradle = "11.2.0"
gradle-versions = "0.42.0"

compose = "1.2.1"
composeCompiler = "1.3.2"
compose = "1.4.0-alpha03"
composeCompiler = "1.4.0-dev-k1.8.0-33c0ad36f83"

android-desugaring = "1.1.8" # Don't bump to 1.2.x until AGP is 7.3.x
androidx-core = "1.8.0"
androidx-core = "1.9.0"
androidx-test-junit = "1.1.3"
androidx-activity-compose = "1.5.1"
androidx-lifecycle = "2.5.1"
Expand All @@ -35,7 +35,7 @@ accompanist-swiperefresh = "0.25.1"
koin = "3.2.0"
multiplatformSettings = "1.0.0-alpha01"
turbine = "0.12.1"
sqlDelight = "1.5.3"
sqlDelight = "1.5.5"

[libraries]
android-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "android-desugaring" }
Expand Down
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Thu Feb 16 12:29:00 CST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
4 changes: 2 additions & 2 deletions ios/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pluginManagement {
google()
mavenCentral()
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/")
}
}

Expand Down
2 changes: 2 additions & 0 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ android {
warningsAsErrors = true
abortOnError = true
}
namespace = "co.touchlab.kampkit"
}

version = "1.2"
Expand Down Expand Up @@ -97,6 +98,7 @@ kotlin {
homepage = "https://github.com/touchlab/KaMPKit"
framework {
isStatic = false // SwiftUI preview requires dynamic framework
linkerOpts("-lsqlite3")
}
ios.deploymentTarget = "12.4"
podfile = project.file("../ios/Podfile")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.squareup.sqldelight.db.SqlDriver
import com.squareup.sqldelight.runtime.coroutines.asFlow
import com.squareup.sqldelight.runtime.coroutines.mapToList
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOn

Expand All @@ -22,7 +23,7 @@ class DatabaseHelper(
dbRef.tableQueries
.selectAll()
.asFlow()
.mapToList()
.mapToList(Dispatchers.Default)
.flowOn(backgroundDispatcher)

suspend fun insertBreeds(breeds: List<String>) {
Expand All @@ -38,7 +39,7 @@ class DatabaseHelper(
dbRef.tableQueries
.selectById(id)
.asFlow()
.mapToList()
.mapToList(Dispatchers.Default)
.flowOn(backgroundDispatcher)

suspend fun deleteAll() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import kotlin.Boolean;

CREATE TABLE Breed (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
Expand Down
3 changes: 1 addition & 2 deletions shared/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.touchlab.kampkit">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>

0 comments on commit c502929

Please sign in to comment.