# HG changeset patch # User Da Risk # Date 1748296160 14400 # Node ID e121390a16d3a440a991387ee6b3312cc1a1d208 # Parent fadd67b0e26c191133feb1cdaf18fc66204f27d6 build: use new kotlin android multiplatform library plugin diff -r fadd67b0e26c -r e121390a16d3 buildSrc/src/main/kotlin/conventions/android.kt --- a/buildSrc/src/main/kotlin/conventions/android.kt Tue Sep 16 15:21:10 2025 -0400 +++ b/buildSrc/src/main/kotlin/conventions/android.kt Mon May 26 17:49:20 2025 -0400 @@ -21,11 +21,26 @@ */ package com.geekorum.build.conventions +import com.android.build.api.dsl.KotlinMultiplatformAndroidLibraryTarget import com.android.build.gradle.BaseExtension import org.gradle.api.Project +import org.gradle.api.plugins.ExtensionAware import org.gradle.kotlin.dsl.findByType +import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension + fun Project.conventionForAndroidProject() { + // new androidLibrary in multiplatform project + extensions.findByType()?.apply { + (this as ExtensionAware).extensions.findByType()?.apply { + compileSdk = 36 + minSdk = 28 + aarMetadata { + minCompileSdk = 28 + } + } + } + extensions.findByType()?.apply { setCompileSdkVersion(36) defaultConfig { diff -r fadd67b0e26c -r e121390a16d3 buildSrc/src/main/kotlin/conventions/mpp-library-with-android.gradle.kts --- a/buildSrc/src/main/kotlin/conventions/mpp-library-with-android.gradle.kts Tue Sep 16 15:21:10 2025 -0400 +++ b/buildSrc/src/main/kotlin/conventions/mpp-library-with-android.gradle.kts Mon May 26 17:49:20 2025 -0400 @@ -23,7 +23,7 @@ plugins { id("com.geekorum.build.conventions.mpp-library") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") } conventionForAndroidProject() diff -r fadd67b0e26c -r e121390a16d3 core/build.gradle.kts --- a/core/build.gradle.kts Tue Sep 16 15:21:10 2025 -0400 +++ b/core/build.gradle.kts Mon May 26 17:49:20 2025 -0400 @@ -28,7 +28,11 @@ } kotlin { - androidTarget() + androidLibrary { + namespace = "com.geekorum.aboutoss.core" + withHostTestBuilder { } + withDeviceTestBuilder { } + } jvm("desktop") @@ -49,9 +53,21 @@ api(libs.kotlinx.coroutines) implementation(libs.kotlinx.serialization.json) } + named("androidHostTest") { + dependencies { + implementation(libs.junit) + } + } + named("androidDeviceTest") { + dependencies { + implementation(libs.androidx.test.ext.junit) + implementation(libs.espresso.core) + } + } } } +/* android { namespace = "com.geekorum.aboutoss.core" @@ -77,13 +93,8 @@ } } } - -dependencies { +*/ - testImplementation(libs.junit) - androidTestImplementation(libs.androidx.test.ext.junit) - androidTestImplementation(libs.espresso.core) -} mavenPublishing { coordinates(groupId = group.toString(), name, version.toString()) diff -r fadd67b0e26c -r e121390a16d3 ui/common/build.gradle.kts --- a/ui/common/build.gradle.kts Tue Sep 16 15:21:10 2025 -0400 +++ b/ui/common/build.gradle.kts Mon May 26 17:49:20 2025 -0400 @@ -29,7 +29,11 @@ } kotlin { - androidTarget() + androidLibrary { + namespace = "com.geekorum.aboutoss.ui.common" + withHostTestBuilder { } + withDeviceTestBuilder { } + } jvm("desktop") @@ -51,12 +55,25 @@ api(libs.jetbrains.androidx.lifecycle.viewmodel) api(compose.components.resources) implementation(compose.runtime) + api(compose.ui) } androidMain.dependencies { api(libs.androidx.activity) implementation(libs.androidx.activity.compose) } + + named("androidHostTest") { + dependencies { + implementation(libs.junit) + } + } + named("androidDeviceTest") { + dependencies { + implementation(libs.androidx.test.ext.junit) + implementation(libs.espresso.core) + } + } } } @@ -64,6 +81,7 @@ publicResClass = true } +/* android { namespace = "com.geekorum.aboutoss.ui.common" @@ -89,11 +107,9 @@ } } } +*/ dependencies { - testImplementation(libs.junit) - androidTestImplementation(libs.androidx.test.ext.junit) - androidTestImplementation(libs.espresso.core) "androidMainApi"(libs.geekdroid) { exclude("androidx.compose.material3") } diff -r fadd67b0e26c -r e121390a16d3 ui/material2/build.gradle.kts --- a/ui/material2/build.gradle.kts Tue Sep 16 15:21:10 2025 -0400 +++ b/ui/material2/build.gradle.kts Mon May 26 17:49:20 2025 -0400 @@ -31,7 +31,11 @@ } kotlin { - androidTarget() + androidLibrary { + namespace = "com.geekorum.aboutoss.ui.material" + withHostTestBuilder { } + withDeviceTestBuilder { } + } jvm("desktop") @@ -62,10 +66,23 @@ implementation(dependencies.platform(libs.androidx.compose.bom)) implementation(libs.androidx.activity.compose) } + + named("androidHostTest") { + dependencies { + implementation(libs.junit) + } + } + named("androidDeviceTest") { + dependencies { + implementation(libs.androidx.test.ext.junit) + implementation(libs.espresso.core) + } + } } } +/* android { namespace = "com.geekorum.aboutoss.ui.material" @@ -95,12 +112,7 @@ } } } - -dependencies { - testImplementation(libs.junit) - androidTestImplementation(libs.androidx.test.ext.junit) - androidTestImplementation(libs.espresso.core) -} +*/ mavenPublishing { val artifactId = "ui-material" diff -r fadd67b0e26c -r e121390a16d3 ui/material3/build.gradle.kts --- a/ui/material3/build.gradle.kts Tue Sep 16 15:21:10 2025 -0400 +++ b/ui/material3/build.gradle.kts Mon May 26 17:49:20 2025 -0400 @@ -30,8 +30,11 @@ } kotlin { - androidTarget() - + androidLibrary { + namespace = "com.geekorum.aboutoss.ui.material3" + withHostTestBuilder { } + withDeviceTestBuilder { } + } jvm("desktop") listOf( @@ -64,10 +67,22 @@ implementation(dependencies.platform(libs.androidx.compose.bom)) implementation(libs.androidx.activity.compose) } + named("androidHostTest") { + dependencies { + implementation(libs.junit) + } + } + named("androidDeviceTest") { + dependencies { + implementation(libs.androidx.test.ext.junit) + implementation(libs.espresso.core) + } + } } } +/* android { namespace = "com.geekorum.aboutoss.ui.material3" @@ -97,14 +112,14 @@ } } } +*/ dependencies { - testImplementation(libs.junit) - androidTestImplementation(libs.androidx.test.ext.junit) - androidTestImplementation(libs.espresso.core) +/* afterEvaluate { "androidDebugImplementation"(libs.androidx.compose.uiTooling) } +*/ } mavenPublishing {