1+ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2+ import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
13import org.jetbrains.kotlin.gradle.dsl.JvmTarget
24
35plugins {
46 id(" com.android.library" )
5- alias(libs.plugins.kotlin.android)
67 alias(libs.plugins.kotlin.compose)
8+ alias(libs.plugins.compose.multiplatform)
9+ alias(libs.plugins.multiplatform)
710
811 id(" maven-publish" )
912}
1013
14+ kotlin {
15+ androidTarget {
16+ @OptIn(ExperimentalKotlinGradlePluginApi ::class )
17+ compilerOptions { jvmTarget.set(JvmTarget .JVM_11 ) }
18+ }
19+
20+ jvm {
21+ @OptIn(ExperimentalKotlinGradlePluginApi ::class )
22+ compilerOptions { jvmTarget.set(JvmTarget .JVM_11 ) }
23+ }
24+
25+ @OptIn(ExperimentalWasmDsl ::class ) wasmJs { browser() }
26+
27+ sourceSets {
28+ commonMain.dependencies {
29+ implementation(compose.ui)
30+ implementation(compose.foundation)
31+ }
32+ androidUnitTest.dependencies { implementation(libs.junit) }
33+ androidInstrumentedTest.dependencies {
34+ implementation(libs.androidx.junit)
35+ implementation(libs.androidx.espresso.core)
36+ implementation(project.dependencies.platform(libs.androidx.compose.bom))
37+ implementation(libs.androidx.compose.ui.test.junit4)
38+ implementation(libs.androidx.compose.ui.tooling)
39+ implementation(libs.androidx.compose.ui.test.manifest)
40+ }
41+ }
42+ }
43+
1144android {
1245 namespace = " com.github.pingpongboss.explodedlayers"
1346 compileSdk = 36
@@ -32,12 +65,13 @@ android {
3265 sourceCompatibility = JavaVersion .VERSION_11
3366 targetCompatibility = JavaVersion .VERSION_11
3467 }
35- kotlin { compilerOptions { jvmTarget = JvmTarget .fromTarget(" 11" ) } }
3668 buildFeatures { compose = true }
37-
38- publishing { singleVariant(" release" ) {} }
3969}
4070
71+ group = " com.github.pingpongboss"
72+
73+ project.extra[" artifactId" ] = " compose-exploded-layers"
74+
4175version =
4276 runCatching {
4377 // Try to get the latest annotated or lightweight tag name
@@ -47,7 +81,7 @@ version =
4781 " 0.0.0-SNAPSHOT" // fallback if no tags yet
4882 }
4983
50- fun String.runCommand (): String =
84+ private fun String.runCommand (): String =
5185 ProcessBuilder (* split(" " ).toTypedArray())
5286 .redirectErrorStream(true )
5387 .start()
@@ -57,13 +91,7 @@ fun String.runCommand(): String =
5791
5892publishing {
5993 publications {
60- create<MavenPublication >(" release" ) {
61- // For Android:
62- afterEvaluate { from(components[" release" ]) }
63-
64- groupId = " com.github.pingpongboss"
65- artifactId = " compose-exploded-layers"
66-
94+ publications.withType<MavenPublication >().configureEach {
6795 pom {
6896 name.set(" Exploded Layers for Jetpack Compose" )
6997 description.set(" Turn any composable into an interactive “3D exploded view”." )
@@ -94,21 +122,3 @@ publishing {
94122 }
95123 }
96124}
97-
98- dependencies {
99- implementation(libs.androidx.core.ktx)
100- implementation(libs.androidx.lifecycle.runtime.ktx)
101- implementation(libs.androidx.activity.compose)
102- implementation(platform(libs.androidx.compose.bom))
103- implementation(libs.androidx.compose.ui)
104- implementation(libs.androidx.compose.ui.graphics)
105- implementation(libs.androidx.compose.ui.tooling.preview)
106- implementation(libs.androidx.compose.material3)
107- testImplementation(libs.junit)
108- androidTestImplementation(libs.androidx.junit)
109- androidTestImplementation(libs.androidx.espresso.core)
110- androidTestImplementation(platform(libs.androidx.compose.bom))
111- androidTestImplementation(libs.androidx.compose.ui.test.junit4)
112- debugImplementation(libs.androidx.compose.ui.tooling)
113- debugImplementation(libs.androidx.compose.ui.test.manifest)
114- }
0 commit comments