Skip to content

Commit 58da79f

Browse files
committed
Move the hierarchy template to common-conventions and move the compose.ui dependency to the common composeUiMain source set
1 parent a8705e5 commit 58da79f

File tree

3 files changed

+19
-29
lines changed

3 files changed

+19
-29
lines changed

buildSrc/src/main/kotlin/common-conventions.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,21 @@ kotlin {
3838
js()
3939

4040

41+
4142
@OptIn(ExperimentalKotlinGradlePluginApi::class)
43+
applyDefaultHierarchyTemplate {
44+
common {
45+
group("composeUi") {
46+
withJvm()
47+
withAndroidTarget()
48+
group("ios")
49+
withWasmJs()
50+
}
51+
}
52+
}
53+
54+
55+
4256
compilerOptions {
4357
freeCompilerArgs.add("-Xexpect-actual-classes")
4458
}

buildSrc/src/main/kotlin/lib-conventions-without-publishing.gradle.kts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2-
31
plugins {
42
id("common-conventions")
53
id("com.huanshankeji.kotlin-multiplatform-conventional-targets")
@@ -11,20 +9,6 @@ kotlin {
119
publishLibraryVariants("release", "debug")
1210
}
1311

14-
// move to `common-conventions` if necessary
15-
16-
@OptIn(ExperimentalKotlinGradlePluginApi::class)
17-
applyDefaultHierarchyTemplate {
18-
common {
19-
group("composeUi") {
20-
withJvm()
21-
withAndroidTarget()
22-
group("ios")
23-
withWasmJs()
24-
}
25-
}
26-
}
27-
2812
/*
2913
sourceSets {
3014
val composeUiMain by creating { dependsOn(commonMain.get()) }

demo/build.gradle.kts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,30 +57,22 @@ kotlin {
5757
implementation(commonDependencies.kotlinx.coroutines.core())
5858
}
5959
}
60+
composeUiMain {
61+
dependencies {
62+
implementation(compose.ui)
63+
}
64+
}
6065
jvmMain {
6166
dependencies {
6267
implementation(compose.desktop.currentOs)
6368
}
6469
}
6570
androidMain {
6671
dependencies {
67-
// TODO consider putting this in `composeUiMain`
68-
implementation(compose.ui)
69-
7072
implementation(commonDependencies.androidx.activity.compose())
7173
implementation(commonDependencies.androidx.compose.ui.module("tooling-preview"))
7274
}
7375
}
74-
iosMain {
75-
dependencies {
76-
implementation(compose.ui)
77-
}
78-
}
79-
wasmJsMain {
80-
dependencies {
81-
implementation(compose.ui)
82-
}
83-
}
8476
jsMain {
8577
dependencies {
8678
implementation(compose.html.core)

0 commit comments

Comments
 (0)