From e697dac81ee93e229fb9aaa5dcb7cd260ae097eb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 21 Dec 2025 08:47:30 +0000 Subject: [PATCH] feat: Migrate to com.android.kotlin.multiplatform.library Migrates the common module from the deprecated 'com.android.library' plugin to the new 'com.android.kotlin.multiplatform.library' plugin. This resolves the Gradle deprecation warning and ensures future compatibility with upcoming Android Gradle Plugin versions. --- build.gradle.kts | 2 +- common/build.gradle.kts | 32 +++++++++----------------------- gradle/libs.versions.toml | 1 + 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3909b1ff..7974f627 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.android.application) apply false - alias(libs.plugins.android.library) apply false + alias(libs.plugins.android.kotlin.multiplatform.library) apply false alias(libs.plugins.sqldelight) apply false alias(libs.plugins.compose.compiler) apply false } diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 0552432d..c8c745db 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -2,21 +2,25 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.kotlin.multiplatform) - alias(libs.plugins.android.library) + alias(libs.plugins.android.kotlin.multiplatform.library) alias(libs.plugins.sqldelight) } group = "com.linuxcommandlibrary" kotlin { - androidTarget() - jvm() - - androidTarget { + androidLibrary { + namespace = "com.linuxcommandlibrary.shared" + compileSdk = 35 + minSdk = 24 compilerOptions { jvmTarget.set(JvmTarget.JVM_17) } + lint { + abortOnError = false + } } + jvm() sourceSets { commonMain { @@ -43,24 +47,6 @@ kotlin { } } -android { - compileSdk = 35 - sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - defaultConfig { - minSdk = 24 - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - lint { - abortOnError = false - } - namespace = "com.linuxcommandlibrary.shared" -} - sqldelight { databases { create("CommandDatabase") { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9a240b92..7a554163 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -51,6 +51,7 @@ kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collec [plugins] android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } +android-kotlin-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }