diff --git a/CHANGELOG.md b/CHANGELOG.md index b26729e..f8750cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ * Introduced nativeMain and nativeTest sourceSets * Added BlockingTest utility interface * Removed snapshot repository support +* macosArm64() target added +* iosSimulatorArm64() target added +* watchosSimulatorArm64() target added +* tvosSimulatorArm64() target added # v1.1.1 diff --git a/buildSrc/src/main/kotlin/plugin.library-mpp.gradle.kts b/buildSrc/src/main/kotlin/plugin.library-mpp.gradle.kts index ad217a3..80eb509 100644 --- a/buildSrc/src/main/kotlin/plugin.library-mpp.gradle.kts +++ b/buildSrc/src/main/kotlin/plugin.library-mpp.gradle.kts @@ -28,7 +28,7 @@ kotlin { dependsOn(commonTest) } } - + explicitApi() jvm() js { @@ -48,13 +48,13 @@ kotlin { // } // } } - + nativeTargetGroup( "androidNdk", androidNativeArm32(), androidNativeArm64(), ) - + nativeTargetGroup( "linux", linuxX64(), @@ -63,40 +63,47 @@ kotlin { linuxArm64(), linuxArm32Hfp(), ) - + nativeTargetGroup( "ios", iosArm32(), iosArm64(), iosX64(), + iosSimulatorArm64(), ) - + nativeTargetGroup( "watchos", watchosArm32(), watchosArm64(), watchosX86(), watchosX64(), + watchosSimulatorArm64(), ) - + nativeTargetGroup( "tvos", tvosArm64(), tvosX64(), + tvosSimulatorArm64(), ) - - macosX64() - + + nativeTargetGroup( + "macos", + macosX64(), + macosArm64(), + ) + nativeTargetGroup( "mingw", mingwX86(), mingwX64(), ) - + val targetsWithCoroutines = KotlinTargetDetails.values() .filter(KotlinTargetDetails::hasCoroutines) .map(KotlinTargetDetails::presetName) - + targets.filter { it.preset?.name in targetsWithCoroutines } .forEach { it.compilations["main"].defaultSourceSet { diff --git a/buildSrc/src/main/kotlin/util/KotlinTargetDetails.kt b/buildSrc/src/main/kotlin/util/KotlinTargetDetails.kt index 792bec7..c3274b7 100644 --- a/buildSrc/src/main/kotlin/util/KotlinTargetDetails.kt +++ b/buildSrc/src/main/kotlin/util/KotlinTargetDetails.kt @@ -1,74 +1,77 @@ -package util - -import org.jetbrains.kotlin.konan.target.Family -import org.jetbrains.kotlin.konan.target.KonanTarget - - -enum class KotlinTargetDetails( - val presetName: String, - val hasCoroutines: Boolean, -) { - JVM("jvm", true), - ANDROID("android", false), - JS("jsIr", true), - - ANDROID_NDK_ARM32("androidNativeArm32", false), - ANDROID_NDK_ARM64("androidNativeArm64", false), - - IOS_ARM32("iosArm32", true), - IOS_ARM64("iosArm64", true), - IOS_X64("iosX64", true), - - WATCHOS_X86("watchosX86", true), - WATCHOS_X64("watchosX64", true), - WATCHOS_ARM64("watchosArm64", true), - WATCHOS_ARM32("watchosArm32", true), - - TVOS_ARM64("tvosArm64", true), - TVOS_X64("tvosX64", true), - - MACOS_X64("macosX64", true), - - LINUX_ARM32_HFP("linuxArm32Hfp", false), - LINUX_MIPS32("linuxMips32", false), - LINUX_MIPSEL32("linuxMipsel32", false), - LINUX_X64("linuxX64", true), - LINUX_ARM64("linuxArm64", false), - - MINGW_X64("mingwX64", true), - MINGW_X32("mingwX86", false), -} - -val KonanTarget.buildHost: Family - get() = when (this) { - KonanTarget.ANDROID_X64, - KonanTarget.ANDROID_X86, - KonanTarget.ANDROID_ARM32, - KonanTarget.ANDROID_ARM64, - KonanTarget.LINUX_ARM64, - KonanTarget.LINUX_ARM32_HFP, - KonanTarget.LINUX_MIPS32, - KonanTarget.LINUX_MIPSEL32, - KonanTarget.LINUX_X64 -> Family.LINUX - - KonanTarget.MINGW_X86, - KonanTarget.MINGW_X64 -> Family.MINGW - - KonanTarget.IOS_ARM32, - KonanTarget.IOS_ARM64, - KonanTarget.IOS_X64, - KonanTarget.IOS_SIMULATOR_ARM64, - KonanTarget.WATCHOS_ARM32, - KonanTarget.WATCHOS_ARM64, - KonanTarget.WATCHOS_X86, - KonanTarget.WATCHOS_X64, - KonanTarget.WATCHOS_SIMULATOR_ARM64, - KonanTarget.TVOS_ARM64, - KonanTarget.TVOS_X64, - KonanTarget.TVOS_SIMULATOR_ARM64, - KonanTarget.MACOS_X64, - KonanTarget.MACOS_ARM64 -> Family.OSX - - KonanTarget.WASM32 -> throw IllegalStateException("Target $this not supported") - is KonanTarget.ZEPHYR -> throw IllegalStateException("Target $this not supported") - } +package util + +import org.jetbrains.kotlin.konan.target.Family +import org.jetbrains.kotlin.konan.target.KonanTarget + +enum class KotlinTargetDetails( + val presetName: String, + val hasCoroutines: Boolean, +) { + JVM("jvm", true), + ANDROID("android", false), + JS("jsIr", true), + + ANDROID_NDK_ARM32("androidNativeArm32", false), + ANDROID_NDK_ARM64("androidNativeArm64", false), + + IOS_ARM32("iosArm32", true), + IOS_ARM64("iosArm64", true), + IOS_X64("iosX64", true), + IOS_SIMULATOR_ARM64("iosSimulatorArm64", true), + + WATCHOS_X86("watchosX86", true), + WATCHOS_X64("watchosX64", true), + WATCHOS_ARM64("watchosArm64", true), + WATCHOS_ARM32("watchosArm32", true), + WATCHOS_SIMULATOR_ARM64("watchosSimulatorArm64", true), + + TVOS_ARM64("tvosArm64", true), + TVOS_X64("tvosX64", true), + TVOS_SIMULATOR_ARM64("tvosSimulatorArm64", true), + + MACOS_X64("macosX64", true), + MACOS_ARM64("macosArm64", true), + + LINUX_ARM32_HFP("linuxArm32Hfp", false), + LINUX_MIPS32("linuxMips32", false), + LINUX_MIPSEL32("linuxMipsel32", false), + LINUX_X64("linuxX64", true), + LINUX_ARM64("linuxArm64", false), + + MINGW_X64("mingwX64", true), + MINGW_X32("mingwX86", false), +} + +val KonanTarget.buildHost: Family + get() = when (this) { + KonanTarget.ANDROID_X64, + KonanTarget.ANDROID_X86, + KonanTarget.ANDROID_ARM32, + KonanTarget.ANDROID_ARM64, + KonanTarget.LINUX_ARM64, + KonanTarget.LINUX_ARM32_HFP, + KonanTarget.LINUX_MIPS32, + KonanTarget.LINUX_MIPSEL32, + KonanTarget.LINUX_X64 -> Family.LINUX + + KonanTarget.MINGW_X86, + KonanTarget.MINGW_X64 -> Family.MINGW + + KonanTarget.IOS_ARM32, + KonanTarget.IOS_ARM64, + KonanTarget.IOS_X64, + KonanTarget.IOS_SIMULATOR_ARM64, + KonanTarget.WATCHOS_ARM32, + KonanTarget.WATCHOS_ARM64, + KonanTarget.WATCHOS_X86, + KonanTarget.WATCHOS_X64, + KonanTarget.WATCHOS_SIMULATOR_ARM64, + KonanTarget.TVOS_ARM64, + KonanTarget.TVOS_X64, + KonanTarget.TVOS_SIMULATOR_ARM64, + KonanTarget.MACOS_X64, + KonanTarget.MACOS_ARM64 -> Family.OSX + + KonanTarget.WASM32 -> throw IllegalStateException("Target $this not supported") + is KonanTarget.ZEPHYR -> throw IllegalStateException("Target $this not supported") + } diff --git a/lib/template-kmp-library-core/src/macosX64Main/kotlin/platform.kt b/lib/template-kmp-library-core/src/macosMain/kotlin/platform.kt similarity index 100% rename from lib/template-kmp-library-core/src/macosX64Main/kotlin/platform.kt rename to lib/template-kmp-library-core/src/macosMain/kotlin/platform.kt diff --git a/lib/template-kmp-library-dsl/src/macosX64Main/kotlin/platform.kt b/lib/template-kmp-library-dsl/src/macosMain/kotlin/platform.kt similarity index 100% rename from lib/template-kmp-library-dsl/src/macosX64Main/kotlin/platform.kt rename to lib/template-kmp-library-dsl/src/macosMain/kotlin/platform.kt diff --git a/test/src/macosX64Main/kotlin/runBlockingTest.kt b/test/src/macosMain/kotlin/runBlockingTest.kt similarity index 100% rename from test/src/macosX64Main/kotlin/runBlockingTest.kt rename to test/src/macosMain/kotlin/runBlockingTest.kt