Skip to content

Commit

Permalink
Use default hierarchy template
Browse files Browse the repository at this point in the history
  • Loading branch information
rickclephas committed Sep 12, 2023
1 parent 3e551c4 commit 540dd8b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 46 deletions.
53 changes: 21 additions & 32 deletions kmp-nativecoroutines-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ plugins {
kotlin {
explicitApi()
jvmToolchain(11)
applyDefaultHierarchyTemplate()

val macosX64 = macosX64()
val macosArm64 = macosArm64()
val iosArm64 = iosArm64()
val iosX64 = iosX64()
val iosSimulatorArm64 = iosSimulatorArm64()
val watchosArm32 = watchosArm32()
val watchosArm64 = watchosArm64()
val watchosX64 = watchosX64()
val watchosSimulatorArm64 = watchosSimulatorArm64()
val watchosDeviceArm64 = watchosDeviceArm64()
val tvosArm64 = tvosArm64()
val tvosX64 = tvosX64()
val tvosSimulatorArm64 = tvosSimulatorArm64()
macosX64()
macosArm64()
iosArm64()
iosX64()
iosSimulatorArm64()
watchosArm32()
watchosArm64()
watchosX64()
watchosSimulatorArm64()
watchosDeviceArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
jvm()
js {
browser()
Expand All @@ -28,47 +29,35 @@ kotlin {
linuxArm64()
linuxX64()
mingwX64()

sourceSets {
all {
languageSettings {
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
val commonMain by getting {
commonMain {
dependencies {
api(libs.kotlinx.coroutines.core)
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(libs.kotlin.test)
implementation(libs.kotlinx.coroutines.test)
}
}
val nativeCoroutinesMain by creating {
dependsOn(commonMain)
dependsOn(commonMain.get())
}
val nativeCoroutinesTest by creating {
dependsOn(commonTest)
dependsOn(commonTest.get())
}
val appleMain by creating {
appleMain {
dependsOn(nativeCoroutinesMain)
}
val appleTest by creating {
appleTest {
dependsOn(nativeCoroutinesTest)
}
listOf(
macosX64, macosArm64,
iosArm64, iosX64, iosSimulatorArm64,
watchosArm32, watchosArm64, watchosX64, watchosSimulatorArm64, watchosDeviceArm64,
tvosArm64, tvosX64, tvosSimulatorArm64
).forEach {
getByName("${it.targetName}Main") {
dependsOn(appleMain)
}
getByName("${it.targetName}Test") {
dependsOn(appleTest)
}
}
}
}
16 changes: 2 additions & 14 deletions sample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,16 @@ kotlin {
all {
languageSettings.optIn("kotlin.experimental.ExperimentalObjCName")
}
val commonMain by getting {
commonMain {
dependencies {
implementation(libs.kotlinx.serialization.json)
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(libs.kotlin.test)
}
}
val appleMain by creating {
dependsOn(commonMain)
}
val appleTest by creating {
dependsOn(commonTest)
}
listOf(
macosX64, macosArm64,
iosArm64, iosX64, iosSimulatorArm64,
Expand All @@ -52,12 +46,6 @@ kotlin {
it.binaries.framework {
baseName = "NativeCoroutinesSampleShared"
}
getByName("${it.targetName}Main") {
dependsOn(appleMain)
}
getByName("${it.targetName}Test") {
dependsOn(appleTest)
}
}
}
}

0 comments on commit 540dd8b

Please sign in to comment.