From 41f3fc3ab76b88ce19dbb510dc4a094d82da25ef Mon Sep 17 00:00:00 2001 From: Ray Yuan Liu Date: Sat, 20 Apr 2024 17:14:47 +0800 Subject: [PATCH 1/2] Upgrade Kotlin and Gradle version --- build.gradle.kts | 1 + buildSrc/src/main/java/AppSettings.kt | 4 ++-- gradle/libs.versions.toml | 16 ++++++++-------- gradle/wrapper/gradle-wrapper.properties | 2 +- shared/build.gradle.kts | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 24e538e..0a96843 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,5 +5,6 @@ plugins { alias(libs.plugins.kotlinAndroid) apply false alias(libs.plugins.kotlinMultiplatform) apply false alias(libs.plugins.ktlintKotlinter) apply false + alias(libs.plugins.sqlDelight) apply false } true // Needed to make the Suppress annotation work for the plugins block \ No newline at end of file diff --git a/buildSrc/src/main/java/AppSettings.kt b/buildSrc/src/main/java/AppSettings.kt index 432d38c..dba6eba 100644 --- a/buildSrc/src/main/java/AppSettings.kt +++ b/buildSrc/src/main/java/AppSettings.kt @@ -1,7 +1,7 @@ import org.gradle.api.JavaVersion object AppSettings { - const val compileSdk = 33 + const val compileSdk = 34 const val targetSdk = 33 const val minSdk = 26 const val applicationId = "com.rayliu.gymnote" @@ -13,6 +13,6 @@ object AppSettings { const val wearVersionName = "0.1" // check: https://developer.android.com/jetpack/androidx/releases/compose-kotlin - const val kotlinCompilerExtensionVersion = "1.4.8" + const val kotlinCompilerExtensionVersion = "1.5.12" val javaVersion = JavaVersion.VERSION_17 } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dcc2600..6b549be 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] -agp = "8.0.2" -kotlin = "1.8.22" +agp = "8.2.2" +kotlin = "1.9.23" core-ktx = "1.10.1" junit = "4.13.2" androidx-test-ext-junit = "1.1.5" @@ -12,18 +12,18 @@ constraintlayout = "2.1.4" percentlayout = "1.0.0" legacy-support-v4 = "1.0.0" recyclerview = "1.3.0" -compose-bom = "2023.06.01" -wear-compose = "1.2.0-beta02" +compose-bom = "2024.04.01" +wear-compose = "1.3.1" lifecycle-runtime-ktx = "2.6.1" -activity-compose = "1.7.2" +activity-compose = "1.9.0" # https://github.com/google/ksp/releases -ksp = "1.8.22-1.0.11" +ksp = "1.9.23-1.0.20" horologist = "0.4.12" wear-input = "1.2.0-alpha02" # kotlinx -collections-immutable = "0.3.5" -datetime = "0.4.0" +collections-immutable = "0.3.7" +datetime = "0.5.0" # koin koin = "3.4.2" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 44e9bc0..9c10a77 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Jun 02 11:08:02 CST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 2ddfcbd..665cc04 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -10,7 +10,7 @@ plugins { } kotlin { - android { + androidTarget { compilations.all { kotlinOptions { jvmTarget = AppSettings.javaVersion.toString() From 8aa82246d0183238f5a10d07ca45f74efd9abf9f Mon Sep 17 00:00:00 2001 From: Ray Yuan Liu Date: Sat, 20 Apr 2024 17:18:09 +0800 Subject: [PATCH 2/2] Update ktlint rules --- .editorconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index d7b75a6..c9d0111 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,6 @@ root = true +[*] +charset = utf-8 [*.{kt,kts}] ktlint_code_style = android @@ -6,4 +8,7 @@ ktlint_standard_final-newline = disabled ktlint_standard_no-wildcard-imports = disabled ktlint_standard_trailing-comma-on-call-site = disabled ktlint_standard_trailing-comma-on-declaration-site = disabled -ktlint_standard_import-ordering = disabled \ No newline at end of file +ktlint_standard_import-ordering = disabled +ktlint_standard_chain-method-continuation = disabled +ktlint_standard_property-naming = disabled +ktlint_standard_backing-property-naming = disabled