From 06d807dda1f3b687cbe034544315e7f322b8ef8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20L=C3=B3pez=20Ma=C3=B1as?= Date: Tue, 11 Jun 2024 19:16:19 +0200 Subject: [PATCH] chore: updated Kotlin to 2.0.0 (#572) --- app/build.gradle | 7 ++----- build.gradle | 4 ++-- gradle.properties | 1 - gradle/libs.versions.toml | 18 ++++++++++-------- maps-compose-utils/build.gradle | 7 ++----- maps-compose-widgets/build.gradle | 7 ++----- maps-compose/build.gradle | 11 ++++------- 7 files changed, 22 insertions(+), 33 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 12768aab0..657140252 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,6 +2,7 @@ plugins { id 'com.android.application' id 'kotlin-android' id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' + alias libs.plugins.compose.compiler } android { @@ -34,10 +35,6 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.composecompiler.get() - } - buildFeatures { buildConfig true compose true @@ -45,7 +42,7 @@ android { kotlinOptions { jvmTarget = '1.8' - freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn' + freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' } } diff --git a/build.gradle b/build.gradle index 26272a448..93798f68f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = libs.versions.kotlin.get() - ext.compose_compiler_version = libs.versions.composecompiler.get() ext.androidx_test_version = libs.versions.androidxtest.get() repositories { google() @@ -18,6 +17,7 @@ buildscript { plugins { alias libs.plugins.dokka apply true + alias libs.plugins.compose.compiler apply false } ext.projectArtifactId = { project -> @@ -124,5 +124,5 @@ subprojects { project -> } tasks.register('clean', Delete) { - delete rootProject.buildDir + delete rootProject.layout.buildDirectory } diff --git a/gradle.properties b/gradle.properties index 9b719907c..8ef066d3c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -30,6 +30,5 @@ signing.secretKeyRingFile= sonatypeUsername= sonatypePassword= -android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=false android.nonFinalResIds=false \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0171ba86a..f1bd26abc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,20 +1,20 @@ [versions] activitycompose = "1.9.0" -agp = "8.4.0" +agp = "8.4.1" androidxtest = "1.5.0" -compose-bom = "2024.04.01" -composecompiler = "1.5.11" +compose-bom = "2024.05.00" coroutines = "1.7.3" -dokka = "1.9.10" +dokka = "1.9.20" espresso = "3.5.1" jacoco-plugin = "0.2.1" jacoco-tool-plugin = "0.8.7" junitktx = "1.1.5" junit = "4.13.2" -kotlin = "1.9.23" -material = "1.11.0" +kotlin = "2.0.0" +material = "1.12.0" mapsktx = "5.0.0" mapsecrets = "2.0.1" +android-core = "1.13.1" [libraries] android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "agp" } @@ -25,7 +25,7 @@ androidx-compose-material = { module = "androidx.compose.material:material" } androidx-compose-ui = { module = "androidx.compose.ui:ui" } androidx-compose-ui-preview-tooling = { module = "androidx.compose.ui:ui-tooling-preview" } androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } -androidx-core = { module = "androidx.core:core-ktx", version = "1.13.0" } +androidx-core = { module = "androidx.core:core-ktx", version = "android-core" } androidx-test-compose-ui = { module = "androidx.compose.ui:ui-test-junit4" } androidx-test-core = { module = "androidx.test:core", version.ref = "androidxtest" } androidx-test-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" } @@ -44,4 +44,6 @@ material = { module = "com.google.android.material:material", version.ref = "mat test-junit = { module = "junit:junit", version.ref = "junit" } [plugins] -dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } \ No newline at end of file +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } \ No newline at end of file diff --git a/maps-compose-utils/build.gradle b/maps-compose-utils/build.gradle index c5ae7898b..5d89a34f9 100644 --- a/maps-compose-utils/build.gradle +++ b/maps-compose-utils/build.gradle @@ -1,5 +1,6 @@ plugins { id 'kotlin-android' + alias libs.plugins.compose.compiler } android { @@ -18,10 +19,6 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.composecompiler.get() - } - buildFeatures { buildConfig false compose true @@ -30,7 +27,7 @@ android { kotlinOptions { jvmTarget = '1.8' freeCompilerArgs += '-Xexplicit-api=strict' - freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn' + freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' } } diff --git a/maps-compose-widgets/build.gradle b/maps-compose-widgets/build.gradle index e36a8d3f1..b0e340826 100644 --- a/maps-compose-widgets/build.gradle +++ b/maps-compose-widgets/build.gradle @@ -1,5 +1,6 @@ plugins { id 'kotlin-android' + alias libs.plugins.compose.compiler } android { @@ -18,10 +19,6 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.composecompiler.get() - } - buildFeatures { buildConfig false compose true @@ -30,7 +27,7 @@ android { kotlinOptions { jvmTarget = '1.8' freeCompilerArgs += '-Xexplicit-api=strict' - freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn' + freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' } } diff --git a/maps-compose/build.gradle b/maps-compose/build.gradle index d8dfc0092..c02a9805d 100644 --- a/maps-compose/build.gradle +++ b/maps-compose/build.gradle @@ -1,5 +1,6 @@ plugins { id 'kotlin-android' + alias libs.plugins.compose.compiler } android { @@ -18,10 +19,6 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - composeOptions { - kotlinCompilerExtensionVersion libs.versions.composecompiler.get() - } - buildFeatures { buildConfig false compose true @@ -30,7 +27,7 @@ android { kotlinOptions { jvmTarget = '1.8' freeCompilerArgs += '-Xexplicit-api=strict' - freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn' + freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' freeCompilerArgs += [ "-P", @@ -42,14 +39,14 @@ android { freeCompilerArgs += [ "-P", "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + - project.buildDir.absolutePath + "/compose_compiler" + project.layout.buildDirectory.absolutePath + "/compose_compiler" ] } if (findProperty("composeCompilerMetrics") == "true") { freeCompilerArgs += [ "-P", "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + - project.buildDir.absolutePath + "/compose_compiler" + project.layout.buildDirectory.absolutePath + "/compose_compiler" ] } }