From 3aa643b598058314d5e01dfec84b947d95633be4 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Wed, 3 Jul 2024 14:48:58 -0300 Subject: [PATCH] Upgrade to kotlin 2 --- .gitignore | 1 + .idea/kotlinc.xml | 2 +- app/build.gradle | 21 +++++++++++++-------- gradle/libs.versions.toml | 5 +++-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index ced986a7..ebeacf69 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ /build /captures .cxx +.kotlin/ # Built application files diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index ae4d11a8..f8de4019 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - diff --git a/app/build.gradle b/app/build.gradle index c75ea725..ff1a33f1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,6 +4,7 @@ plugins { alias(libs.plugins.gradle.ktlint) version(libs.versions.ktlint) alias(libs.plugins.google.gms) version(libs.versions.gms) alias(libs.plugins.kotlin.ksp) version(libs.versions.ksp) + alias(libs.plugins.jetbrainsComposeCompiler) } android { @@ -137,19 +138,11 @@ android { targetCompatibility JavaVersion.VERSION_17 } - kotlinOptions { - jvmTarget = '17' - } - buildFeatures { compose true buildConfig true } - composeOptions { - kotlinCompilerExtensionVersion = "1.5.14" - } - packagingOptions { resources { excludes += '/META-INF/{AL2.0,LGPL2.1}' @@ -157,6 +150,17 @@ android { } } +kotlin { + compilerOptions { + jvmTarget = JvmTarget.JVM_17 + } +} + +composeCompiler { + reportsDestination = layout.buildDirectory.dir("compose_compiler") +} + + dependencies { implementation(libs.quartz) { exclude group: 'net.java.dev.jna' @@ -234,6 +238,7 @@ dependencies { import com.android.tools.profgen.ArtProfileKt import com.android.tools.profgen.ArtProfileSerializer import com.android.tools.profgen.DexFile +import org.jetbrains.kotlin.gradle.dsl.JvmTarget project.afterEvaluate { tasks.each { task -> diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d4a4d98d..cf3e6a83 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,12 +24,12 @@ roomKtx = "2.6.1" securityCryptoKtx = "1.1.0-alpha06" zxingAndroidEmbedded = "4.3.0" okhttp = "5.0.0-alpha.14" -kotlin = "1.9.24" +kotlin = "2.0.0" workRuntimeKtx = "2.9.0" agp = "8.5.0" ktlint = "12.1.1" gms = "4.4.2" -ksp = "1.9.24-1.0.20" +ksp = "2.0.0-1.0.22" [libraries] activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" } @@ -79,3 +79,4 @@ gradle_ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "ktlint" } google_gms = { id = "com.google.gms.google-services", version = "gms" } serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kotlin_ksp = { id = "com.google.devtools.ksp", version = "ksp" } +jetbrainsComposeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }