Skip to content

Commit f0b924d

Browse files
committed
Use applyDefaultHierarchyTemplate() to create "nonJvm" group
1 parent 851f17a commit f0b924d

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

kotlin-codepoints/build.gradle.kts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
1+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
22

33
plugins {
44
alias(libs.plugins.kotlin.multiplatform)
@@ -48,22 +48,21 @@ kotlin {
4848
watchosX64()
4949
watchosSimulatorArm64()
5050

51+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
52+
applyDefaultHierarchyTemplate {
53+
group("nonJvm") {
54+
withJs()
55+
withNative()
56+
withWasm()
57+
}
58+
}
59+
5160
sourceSets {
5261
commonTest {
5362
dependencies {
5463
implementation(kotlin("test"))
5564
}
5665
}
57-
58-
val nonJvmMain by creating {
59-
dependsOn(commonMain.get())
60-
}
61-
}
62-
63-
targets.onEach {
64-
if (it.platformType != KotlinPlatformType.jvm) {
65-
it.compilations.getByName("main").source(sourceSets.getByName("nonJvmMain"))
66-
}
6766
}
6867
}
6968

0 commit comments

Comments
 (0)