1+ import com.android.build.api.dsl.androidLibrary
2+
13plugins {
24 alias(libs.plugins.kotlin.multiplatform)
3- ` maven- publish`
4- id( " com. android.library" )
5+ alias(libs.plugins.vanniktech. maven. publish)
6+ alias(libs.plugins. android.library)
57}
68
79kotlin {
8- androidTarget {
9- publishLibraryVariants(" release" )
10+ androidLibrary {
11+ namespace = " io.github.arthurkun.generic.datastore"
12+ compileSdk = libs.versions.compile.sdk.get().toInt()
13+ minSdk = libs.versions.min.sdk.get().toInt()
14+
15+ withJava()
16+
17+ optimization {
18+ consumerKeepRules.file(" consumer-rules.pro" )
19+ }
20+
21+ withDeviceTest {
22+ instrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
23+ }
1024 }
1125
1226 jvm(" desktop" ) {
1327 testRuns[" test" ].executionTask.configure {
1428 useJUnitPlatform()
1529 }
1630 }
17- // listOf(iosX64(), iosArm64(), iosSimulatorArm64()).forEach { target ->
18- // target.binaries.framework {
19- // baseName = project.name
20- // isStatic = true
21- // }
22- // }
2331
2432 sourceSets {
25- val commonMain by getting {
26- dependencies {
27- implementation(libs.datastore.preferences.core)
28- implementation(libs.kotlinx.serialization.json)
29- }
33+ commonMain.dependencies {
34+ implementation(libs.datastore.preferences.core)
35+ implementation(libs.kotlinx.serialization.json)
3036 }
31- val commonTest by getting {
32- dependencies {
33- implementation(libs.kotlin.test)
34- implementation(libs.junit4)
35- implementation(libs.coroutines.test)
36- }
37+
38+ commonTest.dependencies {
39+ implementation(libs.kotlin.test)
40+ implementation(libs.junit4)
41+ implementation(libs.coroutines.test)
3742 }
3843
39- val androidMain by getting
40- val androidInstrumentedTest by getting {
44+ getByName(" androidDeviceTest" ) {
4145 dependencies {
4246 implementation(libs.datastore.preferences)
4347 implementation(libs.kotlin.test)
@@ -47,8 +51,6 @@ kotlin {
4751 implementation(libs.androidx.test.espresso)
4852 }
4953 }
50-
51- val desktopMain by getting
5254 val desktopTest by getting {
5355 dependencies {
5456 // JVM-specific test dependencies
@@ -64,37 +66,6 @@ kotlin {
6466 }
6567}
6668
67- android {
68- namespace = " io.github.arthurkun.generic.datastore"
69- compileSdk = libs.versions.compile.sdk.get().toInt()
70- defaultConfig {
71- minSdk = libs.versions.min.sdk.get().toInt()
72- consumerProguardFiles(" consumer-rules.pro" ) // Restored for consumers of the library
73- testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
74- }
75- buildTypes {
76- release {
77- isMinifyEnabled = false
78- proguardFiles(
79- getDefaultProguardFile(" proguard-android-optimize.txt" ),
80- " proguard-rules.pro" ,
81- )
82- }
83- }
84- sourceSets {
85- getByName(" androidTest" ) {
86- // Android test source set
87- java.srcDir(" src/androidInstrumentedTest/kotlin" )
88- }
89- }
90- publishing {
91- singleVariant(" release" ) {
92- withSourcesJar()
93- withJavadocJar()
94- }
95- }
96- }
97-
9869publishing {
9970 publications {
10071 withType<MavenPublication > {
0 commit comments