Skip to content

Commit

Permalink
Upgrade to K2 and dependency updates (#369)
Browse files Browse the repository at this point in the history
* Upgrade to K2 and dependency updates

* Update CHANGELOG
  • Loading branch information
vanshg authored May 24, 2024
1 parent 189f473 commit 2f9b136
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
build/
local.properties

# Kotlin 2.0
.kotlin/

# Build artifacts
*.apk
*.aab
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release Notes

## Unreleased

* Update to K2 (aka Kotlin `2.0.0`)
* Update Compose BOM to 2024.05.00
* Update AndroidX to 1.13.1
* Update Activity to 1.9.0
* Update Fragment to 1.7.1
* Update Datastore to 1.1.1
* Update Sentry to 7.9.0

## 10.1.2

* Better error message when the device is low on storage
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ uploadKeystorePassword=<The password for the upload keystore>
length. However, if it is not possible (i.e. a long resource name), you can disable the check for
the line by adding `// ktlint-disable max-line-length` to the end of the line
- You can obtain Compose Compiler metrics (i.e. to debug performance or recomposition issues) by
running `./gradlew clean assemble -PenableComposeCompilerReports=true`. The reports will be
saved to `lib/build/compose-metrics` and `sample/build/compose-metrics`
viewing the reports saved to `lib/build/compose_compiler` and `sample/build/compose_compiler`
- It is recommended to set up a pre-commit hook (ktLint - formatting, lint - Composable lints). To
do so, add the following to `.git/hooks/pre-commit`:
```
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
// Applied depending on sub-module
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.ksp) apply false
Expand Down
30 changes: 15 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
[versions]
accompanist-permissions = "0.34.0"
android-gradle-plugin = "8.2.2"
androidx-activity = "1.8.2"
androidx-compose-bom = "2024.04.00"
androidx-compose-compiler = "1.5.11"
androidx-core = "1.12.0"
androidx-activity = "1.9.0"
androidx-compose-bom = "2024.05.00"
androidx-core = "1.13.1"
androidx-core-splashscreen = "1.0.1"
androidx-fragment = "1.6.2"
androidx-fragment = "1.7.1"
androidx-lifecycle = "2.7.0"
androidx-navigation = "2.7.7"
androidx-test-core = "1.5.0"
androidx-test-espresso = "3.5.1"
androidx-test-fragment = "1.6.2"
androidx-test-fragment = "1.7.1"
androidx-test-junit = "1.1.5"
androidx-test-rules = "1.5.0"
camposer = "0.4.0"
chucker = "4.0.0"
coil = "2.6.0"
compose-lint-checks = "1.3.1"
coroutines = "1.8.0"
datastore = "1.0.0"
coroutines = "1.8.1"
datastore = "1.1.1"
junit = "4.13.2"
kotlin = "1.9.23"
kotlin = "2.0.0"
kotlin-immutable-collections = "0.3.7"
ksp = "1.9.23-1.0.19"
ktlint-plugin = "12.1.0"
leakcanary = "2.13"
ksp = "2.0.0-1.0.21"
ktlint-plugin = "12.1.1"
leakcanary = "2.14"
lottie = "6.4.0"
maven-publish = "0.28.0"
mlkit-code-scanner = "16.1.0"
mlkit-obj-detection = "17.0.1"
mockk = "1.13.10"
mockk = "1.13.11"
moshi = "1.15.1"
moshix = "0.25.1"
moshix = "0.27.0"
moshi-lazy-adapters = "2.2"
okhttp = "4.12.0"
play-services-mlkit-face-detection = "17.1.0"
retrofit = "2.11.0"
sentry = "7.7.0"
sentry = "7.9.0"
tflite = "2.14.0"
tflite-metadata = "0.4.4"
tflite-support = "0.4.4"
Expand All @@ -48,6 +47,7 @@ uiautomator = "2.3.0"
[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
Expand Down
20 changes: 7 additions & 13 deletions lib/lib.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ktlint)
alias(libs.plugins.ksp)
Expand Down Expand Up @@ -61,15 +62,6 @@ android {
// without having to add the opt-in annotation to every usage. The annotation's purpose
// is primarily for consumers of the SDK to use, not for us.
freeCompilerArgs += "-opt-in=com.smileidentity.SmileIDOptIn"
if (project.hasProperty("enableComposeCompilerReports")) {
val outputDir = layout.buildDirectory.dir("compose-reports").get().asFile.path
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$outputDir",
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$outputDir",
)
}
}
}

Expand All @@ -79,16 +71,18 @@ android {
mlModelBinding = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}

lint {
enable += "ComposeM2Api"
error += "ComposeM2Api"
}
}

composeCompiler {
enableStrongSkippingMode = true
reportsDestination = layout.buildDirectory.dir("compose_compiler")
metricsDestination = layout.buildDirectory.dir("compose_compiler")
}

mavenPublishing {
publishToMavenCentral(automaticRelease = true)
signAllPublications()
Expand Down
20 changes: 7 additions & 13 deletions sample/sample.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ktlint)
alias(libs.plugins.moshix)
Expand Down Expand Up @@ -64,15 +65,6 @@ android {
// without having to add the opt-in annotation to every usage. The annotation's purpose
// is primarily for consumers of the SDK to use, not for us.
freeCompilerArgs += "-opt-in=com.smileidentity.SmileIDOptIn"
if (project.hasProperty("enableComposeCompilerReports")) {
val outputDir = layout.buildDirectory.dir("compose-reports").get().asFile.path
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$outputDir",
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$outputDir",
)
}
}
}

Expand All @@ -81,10 +73,6 @@ android {
buildConfig = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}

packaging {
resources.excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
Expand All @@ -97,6 +85,12 @@ android {
}
}

composeCompiler {
enableStrongSkippingMode = true
reportsDestination = layout.buildDirectory.dir("compose_compiler")
metricsDestination = layout.buildDirectory.dir("compose_compiler")
}

val checkSmileConfigFileTaskName = "checkSmileConfigFile"
tasks.register(checkSmileConfigFileTaskName) {
doLast {
Expand Down

0 comments on commit 2f9b136

Please sign in to comment.