From 4ffd04dba8055228d4879198b3337eea793aae87 Mon Sep 17 00:00:00 2001 From: Alexandre G Pereira Date: Sat, 6 Jul 2024 13:22:13 -0300 Subject: [PATCH] Bump kotlin to 2.0 (#281) --- .gitignore | 1 + app/build.gradle.kts | 6 ++-- build.gradle.kts | 1 + buildSrc/build.gradle.kts | 4 +-- core/analytics/build.gradle.kts | 3 ++ feature/folder-detail/android/build.gradle | 5 +-- feature/folder-insert/android/build.gradle | 5 +-- feature/folder-list/android/build.gradle | 5 +-- feature/folder-preview/android/build.gradle | 4 +-- .../monster-compendium/android/build.gradle | 4 +-- .../android/build.gradle | 5 +-- feature/monster-detail/android/build.gradle | 4 +-- .../monster-lore-detail/android/build.gradle | 5 +-- .../monster-registration/android/build.gradle | 4 +-- feature/search/android/build.gradle | 4 +-- feature/settings/android/build.gradle | 4 +-- feature/spell-compendium/android/build.gradle | 4 +-- feature/spell-detail/android/build.gradle | 4 +-- feature/sync/android/build.gradle | 5 +-- gradle.properties | 1 - gradle/libs.versions.toml | 34 +++++++++---------- gradle/wrapper/gradle-wrapper.properties | 2 +- ui/compendium/build.gradle | 5 +-- ui/core/build.gradle | 4 +-- ui/monster-compendium/build.gradle | 5 +-- 25 files changed, 44 insertions(+), 84 deletions(-) diff --git a/.gitignore b/.gitignore index 4d4483eef..5fc8df49a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /workspace.xml *.iml .gradle +.kotlin /local.properties /.idea .DS_Store diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 082ef8a2e..feed0824f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,6 +7,7 @@ plugins { id("kotlin-android") id("com.google.gms.google-services") id("com.google.firebase.crashlytics") + alias(libs.plugins.compose.compiler) } @Suppress("UnstableApiUsage") @@ -88,10 +89,7 @@ android { buildFeatures { compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() + buildConfig = true } } diff --git a/build.gradle.kts b/build.gradle.kts index 4504d7051..06dac4f47 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,4 +18,5 @@ buildscript { plugins { alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.compose.compiler) apply false } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 7ef001545..0a01f8ef7 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -15,7 +15,7 @@ */ plugins { - kotlin("jvm") version "1.9.22" + kotlin("jvm") version "2.0.0" } repositories { @@ -26,6 +26,6 @@ repositories { dependencies { implementation(kotlin("gradle-plugin")) - implementation("com.android.tools.build:gradle:8.2.2") + implementation("com.android.tools.build:gradle:8.3.0") implementation(kotlin("compiler-embeddable")) } diff --git a/core/analytics/build.gradle.kts b/core/analytics/build.gradle.kts index 7728a3269..39950e4dd 100644 --- a/core/analytics/build.gradle.kts +++ b/core/analytics/build.gradle.kts @@ -24,4 +24,7 @@ android { defaultConfig { minSdk = (findProperty("android.minSdk") as String).toInt() } + buildFeatures { + buildConfig = true + } } diff --git a/feature/folder-detail/android/build.gradle b/feature/folder-detail/android/build.gradle index e93bcfe44..03b409b60 100644 --- a/feature/folder-detail/android/build.gradle +++ b/feature/folder-detail/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,10 +19,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } } java { diff --git a/feature/folder-insert/android/build.gradle b/feature/folder-insert/android/build.gradle index ba2537f3d..86e7d31c6 100644 --- a/feature/folder-insert/android/build.gradle +++ b/feature/folder-insert/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,10 +19,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } } java { diff --git a/feature/folder-list/android/build.gradle b/feature/folder-list/android/build.gradle index 72353cc5c..0d3b22c18 100644 --- a/feature/folder-list/android/build.gradle +++ b/feature/folder-list/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,10 +19,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } } java { diff --git a/feature/folder-preview/android/build.gradle b/feature/folder-preview/android/build.gradle index d83de7581..a223e371f 100644 --- a/feature/folder-preview/android/build.gradle +++ b/feature/folder-preview/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,9 +19,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.folder.preview' } diff --git a/feature/monster-compendium/android/build.gradle b/feature/monster-compendium/android/build.gradle index eee3214da..7302249ce 100644 --- a/feature/monster-compendium/android/build.gradle +++ b/feature/monster-compendium/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -24,9 +25,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.monster.compendium' } diff --git a/feature/monster-content-manager/android/build.gradle b/feature/monster-content-manager/android/build.gradle index 30d383a1e..b0609f533 100644 --- a/feature/monster-content-manager/android/build.gradle +++ b/feature/monster-content-manager/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,10 +19,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } } java { diff --git a/feature/monster-detail/android/build.gradle b/feature/monster-detail/android/build.gradle index a27a489ef..7956f4a30 100644 --- a/feature/monster-detail/android/build.gradle +++ b/feature/monster-detail/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -21,9 +22,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.detail' } diff --git a/feature/monster-lore-detail/android/build.gradle b/feature/monster-lore-detail/android/build.gradle index a8389f9c0..45e480a24 100644 --- a/feature/monster-lore-detail/android/build.gradle +++ b/feature/monster-lore-detail/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,10 +19,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } } java { diff --git a/feature/monster-registration/android/build.gradle b/feature/monster-registration/android/build.gradle index dab8344dd..a318c47df 100644 --- a/feature/monster-registration/android/build.gradle +++ b/feature/monster-registration/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,9 +19,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.monster.registration' } diff --git a/feature/search/android/build.gradle b/feature/search/android/build.gradle index 74a5fa661..49a2acfe6 100644 --- a/feature/search/android/build.gradle +++ b/feature/search/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,9 +19,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.search' } diff --git a/feature/settings/android/build.gradle b/feature/settings/android/build.gradle index 09f9cfed8..2e8aa4b3b 100644 --- a/feature/settings/android/build.gradle +++ b/feature/settings/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,9 +19,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.settings' } diff --git a/feature/spell-compendium/android/build.gradle b/feature/spell-compendium/android/build.gradle index de3d340ed..c0ec0bd88 100644 --- a/feature/spell-compendium/android/build.gradle +++ b/feature/spell-compendium/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,9 +19,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.spell.compendium' } diff --git a/feature/spell-detail/android/build.gradle b/feature/spell-detail/android/build.gradle index b0de92e8c..05c0dbbc6 100644 --- a/feature/spell-detail/android/build.gradle +++ b/feature/spell-detail/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,9 +19,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.spell.detail' } diff --git a/feature/sync/android/build.gradle b/feature/sync/android/build.gradle index c3de3c640..9b1339dd6 100644 --- a/feature/sync/android/build.gradle +++ b/feature/sync/android/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,10 +19,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } } java { diff --git a/gradle.properties b/gradle.properties index 0a4c44ef6..376fed1f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,7 +36,6 @@ android.compileSdk=34 android.minSdk=24 xcodeproj=iosApp/MonsterCompendium.xcodeproj kotlin.mpp.androidSourceSetLayoutVersion=2 -android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=true android.nonFinalResIds=true org.gradle.configuration-cache=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8f872fad7..d61778d3d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,29 +1,28 @@ [versions] -android_gradle_plugin = "8.2.2" -appcompat = "1.6.1" +android_gradle_plugin = "8.3.0" +appcompat = "1.7.0" arch_core_testing = "2.2.0" coil_compose = "2.5.0" -compose_activity = '1.8.2' -compose = '1.6.2' -compose_material = '1.6.7' -compose_compiler = '1.5.9' -core_ktx = '1.12.0' -espresso_core = "3.5.1" -firebase_bom = "32.7.2" -googleplay_services = "4.4.1" -gradle_firebase_crashlytics = "2.9.9" -junit_ext = "1.1.5" +compose_activity = '1.9.0' +compose = '1.6.8' +compose_material = '1.6.8' +core_ktx = '1.13.1' +espresso_core = "3.6.1" +firebase_bom = "33.1.1" +googleplay_services = "4.4.2" +gradle_firebase_crashlytics = "3.0.2" +junit_ext = "1.2.1" junit = "4.13.2" koin = '3.5.3' koin_compose = "3.5.3" -kotlin = '1.9.22' +kotlin = '2.0.0' kotlin_coroutines_test = '1.8.1' kotlin_coroutines = '1.8.1' -kotlin_datetime = "0.5.0" +kotlin_datetime = "0.6.0" kotlinx_serialization = "1.6.3" -ktor = "2.3.8" -lifecycle = "2.7.0" -material = "1.11.0" +ktor = "2.3.9" +lifecycle = "2.8.3" +material = "1.12.0" mockk = "1.13.9" multiplatform-settings = "1.1.1" okhttp3_logging_interceptor = "4.12.0" @@ -88,3 +87,4 @@ viewmodel-bundle = ["viewmodel"] [plugins] kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } sqldelight = { id = "com.squareup.sqldelight", version.ref = "sqldelight" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ba1931f43..20cc7df4a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -16,6 +16,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/ui/compendium/build.gradle b/ui/compendium/build.gradle index fe647a56f..0b829a289 100644 --- a/ui/compendium/build.gradle +++ b/ui/compendium/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,10 +19,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } } java { diff --git a/ui/core/build.gradle b/ui/core/build.gradle index 16d5e5c30..7ecfbc878 100644 --- a/ui/core/build.gradle +++ b/ui/core/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -19,9 +20,6 @@ android { compose true } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } namespace 'br.alexandregpereira.hunter.ui' } diff --git a/ui/monster-compendium/build.gradle b/ui/monster-compendium/build.gradle index 8acaac4ec..8c5a0d9b7 100644 --- a/ui/monster-compendium/build.gradle +++ b/ui/monster-compendium/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + alias(libs.plugins.compose.compiler) } android { @@ -18,10 +19,6 @@ android { buildFeatures { compose true } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } } java {