diff --git a/kmp-nativecoroutines-core/build.gradle.kts b/kmp-nativecoroutines-core/build.gradle.kts index 563963f2..13b7b00d 100644 --- a/kmp-nativecoroutines-core/build.gradle.kts +++ b/kmp-nativecoroutines-core/build.gradle.kts @@ -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() @@ -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) - } - } } } diff --git a/sample/shared/build.gradle.kts b/sample/shared/build.gradle.kts index 8e59d9a3..00c44b06 100644 --- a/sample/shared/build.gradle.kts +++ b/sample/shared/build.gradle.kts @@ -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, @@ -52,12 +46,6 @@ kotlin { it.binaries.framework { baseName = "NativeCoroutinesSampleShared" } - getByName("${it.targetName}Main") { - dependsOn(appleMain) - } - getByName("${it.targetName}Test") { - dependsOn(appleTest) - } } } }