From 6c843c4dd44b8b2cebeffc20c02d03e1cf7c5bbd Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 28 Aug 2026 23:04:25 +0600 Subject: [PATCH] migrate onto new android dsl --- android/alerts/common/build.gradle | 2 +- android/alerts/recyclerview/build.gradle | 2 +- android/pickers/build.gradle | 2 +- android/recyclerview/build.gradle | 2 +- android/smalltextfield/build.gradle | 2 +- colors/build.gradle | 2 +- colors/common/build.gradle | 2 +- common/build.gradle | 4 +- common/compose/build.gradle | 2 +- coroutines/build.gradle | 2 +- coroutines/compose/build.gradle | 2 +- crypto/build.gradle | 10 +---- dokka/build.gradle | 10 +++-- fsm/common/build.gradle | 2 +- fsm/repos/common/build.gradle | 2 +- gradle.properties | 2 - gradle/templates/addComposeForAndroid.gradle | 2 +- .../templates/defaultAndroidSettings.gradle | 42 ++++++------------- gradle/templates/enableMPPAndroid.gradle | 34 ++++++++------- koin/build.gradle | 4 +- koin/generator/test/build.gradle | 2 +- ksp/classcasts/build.gradle | 2 +- ksp/classcasts/generator/test/build.gradle | 2 +- ksp/sealed/build.gradle | 2 +- ksp/sealed/generator/test/build.gradle | 2 +- ksp/variations/build.gradle | 2 +- ksp/variations/generator/test/build.gradle | 2 +- ktor/client/build.gradle | 2 +- ktor/common/build.gradle | 2 +- language_codes/build.gradle | 2 +- matrix/build.gradle | 2 +- meta/build.gradle | 2 +- mime_types/build.gradle | 2 +- pagination/common/build.gradle | 2 +- pagination/compose/build.gradle | 2 +- pagination/ktor/common/build.gradle | 2 +- repos/cache/build.gradle | 2 +- repos/common/build.gradle | 4 +- repos/common/tests/build.gradle | 22 +++++----- repos/generator/test/build.gradle | 2 +- repos/inmemory/build.gradle | 4 +- repos/ktor/client/build.gradle | 2 +- repos/ktor/common/build.gradle | 2 +- resources/build.gradle | 2 +- safe_wrapper/build.gradle | 2 +- selector/common/build.gradle | 2 +- serialization/base64/build.gradle | 2 +- serialization/encapsulator/build.gradle | 2 +- serialization/mapper/build.gradle | 2 +- serialization/typed_serializer/build.gradle | 2 +- startup/template/client/build.gradle | 2 +- startup/template/common/build.gradle | 2 +- transactions/build.gradle | 2 +- 53 files changed, 101 insertions(+), 121 deletions(-) diff --git a/android/alerts/common/build.gradle b/android/alerts/common/build.gradle index 29e8f55fbab..f3beb1212b6 100644 --- a/android/alerts/common/build.gradle +++ b/android/alerts/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppAndroidProject" diff --git a/android/alerts/recyclerview/build.gradle b/android/alerts/recyclerview/build.gradle index 7149cb1f952..5549580663a 100644 --- a/android/alerts/recyclerview/build.gradle +++ b/android/alerts/recyclerview/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppAndroidProject" diff --git a/android/pickers/build.gradle b/android/pickers/build.gradle index faacb584ba8..7bb946eb220 100644 --- a/android/pickers/build.gradle +++ b/android/pickers/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" alias(libs.plugins.jb.compose) alias(libs.plugins.kt.jb.compose) } diff --git a/android/recyclerview/build.gradle b/android/recyclerview/build.gradle index ec233210840..e62b7d4ebe0 100644 --- a/android/recyclerview/build.gradle +++ b/android/recyclerview/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppAndroidProject" diff --git a/android/smalltextfield/build.gradle b/android/smalltextfield/build.gradle index 8e23828c7b4..b6c036d82f4 100644 --- a/android/smalltextfield/build.gradle +++ b/android/smalltextfield/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" alias(libs.plugins.jb.compose) alias(libs.plugins.kt.jb.compose) } diff --git a/colors/build.gradle b/colors/build.gradle index edc807db7ea..2dcc338911f 100644 --- a/colors/build.gradle +++ b/colors/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/colors/common/build.gradle b/colors/common/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/colors/common/build.gradle +++ b/colors/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/common/build.gradle b/common/build.gradle index 32056af686b..058da15463d 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" @@ -13,7 +13,7 @@ kotlin { api libs.klock } } - jvmMain { + jvmAndAndroidMain { dependencies { api project(":micro_utils.coroutines") } diff --git a/common/compose/build.gradle b/common/compose/build.gradle index 9a5b52e22b2..87358af4514 100644 --- a/common/compose/build.gradle +++ b/common/compose/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" alias(libs.plugins.jb.compose) alias(libs.plugins.kt.jb.compose) } diff --git a/coroutines/build.gradle b/coroutines/build.gradle index a4c6a2a18e6..76e5e6d823d 100644 --- a/coroutines/build.gradle +++ b/coroutines/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/coroutines/compose/build.gradle b/coroutines/compose/build.gradle index 3e93c9f3895..3bccd535019 100644 --- a/coroutines/compose/build.gradle +++ b/coroutines/compose/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" alias(libs.plugins.jb.compose) alias(libs.plugins.kt.jb.compose) } diff --git a/crypto/build.gradle b/crypto/build.gradle index c0ed52a829d..c2127e979a6 100644 --- a/crypto/build.gradle +++ b/crypto/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" @@ -21,11 +21,3 @@ kotlin { } } } - -android { - sourceSets { - main { - java.srcDirs += [ "src/jvmMain/kotlin" ] - } - } -} diff --git a/dokka/build.gradle b/dokka/build.gradle index d9cee30203e..7c169a343b4 100644 --- a/dokka/build.gradle +++ b/dokka/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" id "org.jetbrains.dokka" } @@ -11,13 +11,17 @@ repositories { mavenCentral() } +apply from: "$defaultAndroidSettings" + kotlin { jvm() js(IR) { browser() nodejs() } - androidTarget {} + android { + project.ext.configureAndroidTarget(delegate) + } sourceSets { commonMain { @@ -137,5 +141,3 @@ dokka { // } // } //} - -apply from: "$defaultAndroidSettings" diff --git a/fsm/common/build.gradle b/fsm/common/build.gradle index 483a2b0eaff..af2171bfec8 100644 --- a/fsm/common/build.gradle +++ b/fsm/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/fsm/repos/common/build.gradle b/fsm/repos/common/build.gradle index 022d10790af..72f3dcfcafd 100644 --- a/fsm/repos/common/build.gradle +++ b/fsm/repos/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/gradle.properties b/gradle.properties index 86ed43f5269..b9cdd4c552e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,6 @@ kotlin.incremental=true kotlin.incremental.js=true #kotlin.experimental.tryK2=true android.useAndroidX=true -android.builtInKotlin=false -android.newDsl=false org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=2g ## https://github.com/google/ksp/issues/2491 diff --git a/gradle/templates/addComposeForAndroid.gradle b/gradle/templates/addComposeForAndroid.gradle index 5dedc38ca31..592e64d90f3 100644 --- a/gradle/templates/addComposeForAndroid.gradle +++ b/gradle/templates/addComposeForAndroid.gradle @@ -1,6 +1,6 @@ kotlin { sourceSets { - androidUnitTest { + androidHostTest { dependencies { implementation compose.uiTest } diff --git a/gradle/templates/defaultAndroidSettings.gradle b/gradle/templates/defaultAndroidSettings.gradle index c3f41ef8580..dc0db6bb4b4 100644 --- a/gradle/templates/defaultAndroidSettings.gradle +++ b/gradle/templates/defaultAndroidSettings.gradle @@ -1,34 +1,18 @@ apply plugin: 'com.getkeepsafe.dexcount' -android { - compileSdkVersion libs.versions.android.props.compileSdk.get().toInteger() - buildToolsVersion libs.versions.android.props.buildTools.get() - - defaultConfig { - minSdkVersion libs.versions.android.props.minSdk.get().toInteger() - compileSdkVersion libs.versions.android.props.compileSdk.get().toInteger() - targetSdkVersion libs.versions.android.props.compileSdk.get().toInteger() - versionCode "${android_code_version}".toInteger() - versionName "$version" - namespace "${project.group}.${project.name}" - } - buildTypes { - release { - minifyEnabled false - } - debug { - debuggable true +ext.configureAndroidTarget = { target -> + target.compileSdk = libs.versions.android.props.compileSdk.get().toInteger() + target.buildToolsVersion = libs.versions.android.props.buildTools.get() + target.minSdk = libs.versions.android.props.minSdk.get().toInteger() + target.namespace = "${project.group}.${project.name}" + target.packaging { + resources { + excludes.add 'META-INF/kotlinx-serialization-runtime.kotlin_module' + excludes.add 'META-INF/kotlinx-serialization-cbor.kotlin_module' + excludes.add 'META-INF/kotlinx-serialization-properties.kotlin_module' } } - - packagingOptions { - exclude 'META-INF/kotlinx-serialization-runtime.kotlin_module' - exclude 'META-INF/kotlinx-serialization-cbor.kotlin_module' - exclude 'META-INF/kotlinx-serialization-properties.kotlin_module' - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } + target.compilerOptions.jvmTarget.set( + target.compilerOptions.jvmTarget.get().class.fromTarget("17") + ) } diff --git a/gradle/templates/enableMPPAndroid.gradle b/gradle/templates/enableMPPAndroid.gradle index 1f97e734e15..71f3a055161 100644 --- a/gradle/templates/enableMPPAndroid.gradle +++ b/gradle/templates/enableMPPAndroid.gradle @@ -1,25 +1,31 @@ +apply from: "$defaultAndroidSettings" + kotlin { - androidTarget { - publishLibraryVariants( - "release", - "debug", - ) - compilations.all { - kotlinOptions { - jvmTarget = "17" - } - } + android { + project.ext.configureAndroidTarget(delegate) + withHostTest {} + withDeviceTest {} } sourceSets { - androidUnitTest { + jvmAndAndroidMain { + dependsOn commonMain + kotlin.srcDir("src/jvmMain/kotlin") + resources.srcDir("src/jvmMain/resources") + } + jvmMain { + dependsOn jvmAndAndroidMain + kotlin.setSrcDirs([]) + resources.setSrcDirs([]) + } + androidHostTest { dependencies { implementation kotlin('test-junit') implementation libs.android.test.junit implementation libs.android.espresso } } - androidInstrumentedTest { + androidDeviceTest { dependencies { implementation kotlin('test-junit') implementation libs.android.test.junit @@ -27,8 +33,6 @@ kotlin { } } - androidMain.dependsOn jvmMain + androidMain.dependsOn jvmAndAndroidMain } } - -apply from: "$defaultAndroidSettings" diff --git a/koin/build.gradle b/koin/build.gradle index 3631b59151f..1096696182d 100644 --- a/koin/build.gradle +++ b/koin/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" @@ -14,7 +14,7 @@ kotlin { api libs.uuid } } - jvmMain { + jvmAndAndroidMain { dependencies { api libs.kt.reflect api project(":micro_utils.coroutines") diff --git a/koin/generator/test/build.gradle b/koin/generator/test/build.gradle index 8c9bbc239d5..87bbd5f35df 100644 --- a/koin/generator/test/build.gradle +++ b/koin/generator/test/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" id "com.google.devtools.ksp" } diff --git a/ksp/classcasts/build.gradle b/ksp/classcasts/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/ksp/classcasts/build.gradle +++ b/ksp/classcasts/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/ksp/classcasts/generator/test/build.gradle b/ksp/classcasts/generator/test/build.gradle index bbae41dde1b..280cd942c85 100644 --- a/ksp/classcasts/generator/test/build.gradle +++ b/ksp/classcasts/generator/test/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" id "com.google.devtools.ksp" } diff --git a/ksp/sealed/build.gradle b/ksp/sealed/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/ksp/sealed/build.gradle +++ b/ksp/sealed/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/ksp/sealed/generator/test/build.gradle b/ksp/sealed/generator/test/build.gradle index ab28fb2bbcc..32e66e30a60 100644 --- a/ksp/sealed/generator/test/build.gradle +++ b/ksp/sealed/generator/test/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" id "com.google.devtools.ksp" } diff --git a/ksp/variations/build.gradle b/ksp/variations/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/ksp/variations/build.gradle +++ b/ksp/variations/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/ksp/variations/generator/test/build.gradle b/ksp/variations/generator/test/build.gradle index 00d90fe74a9..1cf92751dd0 100644 --- a/ksp/variations/generator/test/build.gradle +++ b/ksp/variations/generator/test/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" id "com.google.devtools.ksp" } diff --git a/ktor/client/build.gradle b/ktor/client/build.gradle index 684e71044e6..40d423c03c0 100644 --- a/ktor/client/build.gradle +++ b/ktor/client/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/ktor/common/build.gradle b/ktor/common/build.gradle index e7667860720..484925e0873 100644 --- a/ktor/common/build.gradle +++ b/ktor/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/language_codes/build.gradle b/language_codes/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/language_codes/build.gradle +++ b/language_codes/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/matrix/build.gradle b/matrix/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/matrix/build.gradle +++ b/matrix/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/meta/build.gradle b/meta/build.gradle index c7c28b5572b..5be7a3ccb04 100644 --- a/meta/build.gradle +++ b/meta/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/mime_types/build.gradle b/mime_types/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/mime_types/build.gradle +++ b/mime_types/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/pagination/common/build.gradle b/pagination/common/build.gradle index cbe5931cc81..8114703dcd7 100644 --- a/pagination/common/build.gradle +++ b/pagination/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/pagination/compose/build.gradle b/pagination/compose/build.gradle index bb7862242db..68b0af38986 100644 --- a/pagination/compose/build.gradle +++ b/pagination/compose/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" alias(libs.plugins.jb.compose) alias(libs.plugins.kt.jb.compose) } diff --git a/pagination/ktor/common/build.gradle b/pagination/ktor/common/build.gradle index d19e4186c66..633be75def7 100644 --- a/pagination/ktor/common/build.gradle +++ b/pagination/ktor/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/repos/cache/build.gradle b/repos/cache/build.gradle index 1608282c11f..dc6cccc4cfa 100644 --- a/repos/cache/build.gradle +++ b/repos/cache/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/repos/common/build.gradle b/repos/common/build.gradle index 8c34d5fe839..76c11ff795a 100644 --- a/repos/common/build.gradle +++ b/repos/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" @@ -17,7 +17,7 @@ kotlin { } } - jvmMain { + jvmAndAndroidMain { dependencies { api internalProject("micro_utils.common") } diff --git a/repos/common/tests/build.gradle b/repos/common/tests/build.gradle index 173e538b797..3bbc4795a0a 100644 --- a/repos/common/tests/build.gradle +++ b/repos/common/tests/build.gradle @@ -1,12 +1,14 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } project.version = "$version" project.group = "$group" +apply from: "$defaultAndroidSettings" + kotlin { jvm { compilations.main { @@ -23,12 +25,8 @@ kotlin { browser() nodejs() } - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = "17" - } - } + android { + project.ext.configureAndroidTarget(delegate) } linuxX64() mingwX64() @@ -51,6 +49,11 @@ kotlin { implementation kotlin('test-junit') } } + androidMain { + dependencies { + implementation kotlin('test-junit') + } + } jsMain { dependencies { implementation kotlin('test-js') @@ -61,13 +64,10 @@ kotlin { mingwX64Main.dependsOn nativeMain linuxArm64Main.dependsOn nativeMain - androidMain.dependsOn jvmMain } } -apply from: "$defaultAndroidSettings" - java { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 -} \ No newline at end of file +} diff --git a/repos/generator/test/build.gradle b/repos/generator/test/build.gradle index d548d6e10b3..a627b670e5c 100644 --- a/repos/generator/test/build.gradle +++ b/repos/generator/test/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" id "com.google.devtools.ksp" } diff --git a/repos/inmemory/build.gradle b/repos/inmemory/build.gradle index bdf6a7ecfe1..c29079d8c32 100644 --- a/repos/inmemory/build.gradle +++ b/repos/inmemory/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" @@ -20,4 +20,4 @@ kotlin { } } } -} \ No newline at end of file +} diff --git a/repos/ktor/client/build.gradle b/repos/ktor/client/build.gradle index 5906cd72a10..b39d0e921db 100644 --- a/repos/ktor/client/build.gradle +++ b/repos/ktor/client/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/repos/ktor/common/build.gradle b/repos/ktor/common/build.gradle index 793de002335..52bd312dd10 100644 --- a/repos/ktor/common/build.gradle +++ b/repos/ktor/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/resources/build.gradle b/resources/build.gradle index 3d99c758f28..dc3c9afc9ec 100644 --- a/resources/build.gradle +++ b/resources/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/safe_wrapper/build.gradle b/safe_wrapper/build.gradle index c70b4fc57cf..7290568a936 100644 --- a/safe_wrapper/build.gradle +++ b/safe_wrapper/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/selector/common/build.gradle b/selector/common/build.gradle index eddc68fc40f..6581da93e12 100644 --- a/selector/common/build.gradle +++ b/selector/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/serialization/base64/build.gradle b/serialization/base64/build.gradle index 0007fbefc2a..d6a623d6d22 100644 --- a/serialization/base64/build.gradle +++ b/serialization/base64/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/serialization/encapsulator/build.gradle b/serialization/encapsulator/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/serialization/encapsulator/build.gradle +++ b/serialization/encapsulator/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/serialization/mapper/build.gradle b/serialization/mapper/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/serialization/mapper/build.gradle +++ b/serialization/mapper/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/serialization/typed_serializer/build.gradle b/serialization/typed_serializer/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/serialization/typed_serializer/build.gradle +++ b/serialization/typed_serializer/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/startup/template/client/build.gradle b/startup/template/client/build.gradle index 9cd774ee9d7..1bffe70e6a1 100644 --- a/startup/template/client/build.gradle +++ b/startup/template/client/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" alias(libs.plugins.compose) } diff --git a/startup/template/common/build.gradle b/startup/template/common/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/startup/template/common/build.gradle +++ b/startup/template/common/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project" diff --git a/transactions/build.gradle b/transactions/build.gradle index a2e3bb55ba4..d3c22f34ce0 100644 --- a/transactions/build.gradle +++ b/transactions/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" - id "com.android.library" + id "com.android.kotlin.multiplatform.library" } apply from: "$mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project"