[KT-43276] Add watchos_x64 target
This commit is contained in:
+1
-1
@@ -729,7 +729,7 @@ open class KotlinMPPGradleProjectResolver : AbstractProjectResolverExtensionComp
|
||||
val copyFrom = when {
|
||||
compilations.all { it.isAppleCompilation } ->
|
||||
compilations.selectFirstAvailableTarget(
|
||||
"watchos_arm64", "watchos_arm32", "watchos_x86",
|
||||
"watchos_arm64", "watchos_arm32", "watchos_x64", "watchos_x86",
|
||||
"ios_arm64", "ios_arm32", "ios_x64",
|
||||
"tvos_arm64", "tvos_x64"
|
||||
)
|
||||
|
||||
+2
-3
@@ -49,11 +49,10 @@ internal val androidPresetEntry = KotlinPresetEntry(
|
||||
|
||||
// Note: modifying these sets should also be reflected in the MPP plugin code, see 'setupDefaultPresets'
|
||||
private val nativeTargetsWithHostTests = setOf(KonanTarget.LINUX_X64, KonanTarget.MACOS_X64, KonanTarget.MINGW_X64)
|
||||
private val nativeTargetsWithSimulatorTests = setOf(KonanTarget.IOS_X64, KonanTarget.WATCHOS_X86, KonanTarget.TVOS_X64)
|
||||
private val disabledNativeTargets = setOf(KonanTarget.WATCHOS_X64)
|
||||
private val nativeTargetsWithSimulatorTests =
|
||||
setOf(KonanTarget.IOS_X64, KonanTarget.WATCHOS_X86, KonanTarget.WATCHOS_X64, KonanTarget.TVOS_X64)
|
||||
|
||||
internal val nativePresetEntries = HostManager().targets
|
||||
.filter { (_, target) -> target !in disabledNativeTargets }
|
||||
.map { (_, target) ->
|
||||
|
||||
val (presetType, targetType) = when (target) {
|
||||
|
||||
+106
-83
@@ -3,7 +3,15 @@ package org.jetbrains.kotlin.gradle.dsl
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.util.ConfigureUtil
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTargetsContainerWithPresets
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTargetPreset
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmTargetPreset
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetPreset
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTestsPreset
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTests
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTestsPreset
|
||||
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
||||
|
||||
// DO NOT EDIT MANUALLY! Generated by org.jetbrains.kotlin.generators.gradle.dsl.MppPresetFunctionsCodegenKt
|
||||
@@ -40,6 +48,36 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP
|
||||
fun android(name: String, configure: Closure<*>) = android(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun android(configure: Closure<*>) = android { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun androidNativeX64(
|
||||
name: String = "androidNativeX64",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
): KotlinNativeTarget =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("androidNativeX64") as KotlinNativeTargetPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun androidNativeX64() = androidNativeX64("androidNativeX64") { }
|
||||
fun androidNativeX64(name: String) = androidNativeX64(name) { }
|
||||
fun androidNativeX64(name: String, configure: Closure<*>) = androidNativeX64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun androidNativeX64(configure: Closure<*>) = androidNativeX64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun androidNativeX86(
|
||||
name: String = "androidNativeX86",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
): KotlinNativeTarget =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("androidNativeX86") as KotlinNativeTargetPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun androidNativeX86() = androidNativeX86("androidNativeX86") { }
|
||||
fun androidNativeX86(name: String) = androidNativeX86(name) { }
|
||||
fun androidNativeX86(name: String, configure: Closure<*>) = androidNativeX86(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun androidNativeX86(configure: Closure<*>) = androidNativeX86 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun androidNativeArm32(
|
||||
name: String = "androidNativeArm32",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
@@ -70,36 +108,6 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP
|
||||
fun androidNativeArm64(name: String, configure: Closure<*>) = androidNativeArm64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun androidNativeArm64(configure: Closure<*>) = androidNativeArm64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun androidNativeX86(
|
||||
name: String = "androidNativeX86",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
): KotlinNativeTarget =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("androidNativeX86") as KotlinNativeTargetPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun androidNativeX86() = androidNativeX86("androidNativeX86") { }
|
||||
fun androidNativeX86(name: String) = androidNativeX86(name) { }
|
||||
fun androidNativeX86(name: String, configure: Closure<*>) = androidNativeX86(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun androidNativeX86(configure: Closure<*>) = androidNativeX86 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun androidNativeX64(
|
||||
name: String = "androidNativeX64",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
): KotlinNativeTarget =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("androidNativeX64") as KotlinNativeTargetPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun androidNativeX64() = androidNativeX64("androidNativeX64") { }
|
||||
fun androidNativeX64(name: String) = androidNativeX64(name) { }
|
||||
fun androidNativeX64(name: String, configure: Closure<*>) = androidNativeX64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun androidNativeX64(configure: Closure<*>) = androidNativeX64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun iosArm32(
|
||||
name: String = "iosArm32",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
@@ -190,6 +198,21 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP
|
||||
fun watchosX86(name: String, configure: Closure<*>) = watchosX86(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun watchosX86(configure: Closure<*>) = watchosX86 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun watchosX64(
|
||||
name: String = "watchosX64",
|
||||
configure: KotlinNativeTargetWithSimulatorTests.() -> Unit = { }
|
||||
): KotlinNativeTargetWithSimulatorTests =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("watchosX64") as KotlinNativeTargetWithSimulatorTestsPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun watchosX64() = watchosX64("watchosX64") { }
|
||||
fun watchosX64(name: String) = watchosX64(name) { }
|
||||
fun watchosX64(name: String, configure: Closure<*>) = watchosX64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun watchosX64(configure: Closure<*>) = watchosX64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun tvosArm64(
|
||||
name: String = "tvosArm64",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
@@ -235,20 +258,50 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP
|
||||
fun linuxX64(name: String, configure: Closure<*>) = linuxX64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun linuxX64(configure: Closure<*>) = linuxX64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun linuxArm32Hfp(
|
||||
name: String = "linuxArm32Hfp",
|
||||
fun mingwX86(
|
||||
name: String = "mingwX86",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
): KotlinNativeTarget =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("linuxArm32Hfp") as KotlinNativeTargetPreset,
|
||||
presets.getByName("mingwX86") as KotlinNativeTargetPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun linuxArm32Hfp() = linuxArm32Hfp("linuxArm32Hfp") { }
|
||||
fun linuxArm32Hfp(name: String) = linuxArm32Hfp(name) { }
|
||||
fun linuxArm32Hfp(name: String, configure: Closure<*>) = linuxArm32Hfp(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun linuxArm32Hfp(configure: Closure<*>) = linuxArm32Hfp { ConfigureUtil.configure(configure, this) }
|
||||
fun mingwX86() = mingwX86("mingwX86") { }
|
||||
fun mingwX86(name: String) = mingwX86(name) { }
|
||||
fun mingwX86(name: String, configure: Closure<*>) = mingwX86(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun mingwX86(configure: Closure<*>) = mingwX86 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun mingwX64(
|
||||
name: String = "mingwX64",
|
||||
configure: KotlinNativeTargetWithHostTests.() -> Unit = { }
|
||||
): KotlinNativeTargetWithHostTests =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("mingwX64") as KotlinNativeTargetWithHostTestsPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun mingwX64() = mingwX64("mingwX64") { }
|
||||
fun mingwX64(name: String) = mingwX64(name) { }
|
||||
fun mingwX64(name: String, configure: Closure<*>) = mingwX64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun mingwX64(configure: Closure<*>) = mingwX64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun macosX64(
|
||||
name: String = "macosX64",
|
||||
configure: KotlinNativeTargetWithHostTests.() -> Unit = { }
|
||||
): KotlinNativeTargetWithHostTests =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("macosX64") as KotlinNativeTargetWithHostTestsPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun macosX64() = macosX64("macosX64") { }
|
||||
fun macosX64(name: String) = macosX64(name) { }
|
||||
fun macosX64(name: String, configure: Closure<*>) = macosX64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun macosX64(configure: Closure<*>) = macosX64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun linuxArm64(
|
||||
name: String = "linuxArm64",
|
||||
@@ -265,6 +318,21 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP
|
||||
fun linuxArm64(name: String, configure: Closure<*>) = linuxArm64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun linuxArm64(configure: Closure<*>) = linuxArm64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun linuxArm32Hfp(
|
||||
name: String = "linuxArm32Hfp",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
): KotlinNativeTarget =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("linuxArm32Hfp") as KotlinNativeTargetPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun linuxArm32Hfp() = linuxArm32Hfp("linuxArm32Hfp") { }
|
||||
fun linuxArm32Hfp(name: String) = linuxArm32Hfp(name) { }
|
||||
fun linuxArm32Hfp(name: String, configure: Closure<*>) = linuxArm32Hfp(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun linuxArm32Hfp(configure: Closure<*>) = linuxArm32Hfp { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun linuxMips32(
|
||||
name: String = "linuxMips32",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
@@ -295,51 +363,6 @@ interface KotlinTargetContainerWithPresetFunctions : KotlinTargetsContainerWithP
|
||||
fun linuxMipsel32(name: String, configure: Closure<*>) = linuxMipsel32(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun linuxMipsel32(configure: Closure<*>) = linuxMipsel32 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun mingwX64(
|
||||
name: String = "mingwX64",
|
||||
configure: KotlinNativeTargetWithHostTests.() -> Unit = { }
|
||||
): KotlinNativeTargetWithHostTests =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("mingwX64") as KotlinNativeTargetWithHostTestsPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun mingwX64() = mingwX64("mingwX64") { }
|
||||
fun mingwX64(name: String) = mingwX64(name) { }
|
||||
fun mingwX64(name: String, configure: Closure<*>) = mingwX64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun mingwX64(configure: Closure<*>) = mingwX64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun mingwX86(
|
||||
name: String = "mingwX86",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
): KotlinNativeTarget =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("mingwX86") as KotlinNativeTargetPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun mingwX86() = mingwX86("mingwX86") { }
|
||||
fun mingwX86(name: String) = mingwX86(name) { }
|
||||
fun mingwX86(name: String, configure: Closure<*>) = mingwX86(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun mingwX86(configure: Closure<*>) = mingwX86 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun macosX64(
|
||||
name: String = "macosX64",
|
||||
configure: KotlinNativeTargetWithHostTests.() -> Unit = { }
|
||||
): KotlinNativeTargetWithHostTests =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("macosX64") as KotlinNativeTargetWithHostTestsPreset,
|
||||
configure
|
||||
)
|
||||
|
||||
fun macosX64() = macosX64("macosX64") { }
|
||||
fun macosX64(name: String) = macosX64(name) { }
|
||||
fun macosX64(name: String, configure: Closure<*>) = macosX64(name) { ConfigureUtil.configure(configure, this) }
|
||||
fun macosX64(configure: Closure<*>) = macosX64 { ConfigureUtil.configure(configure, this) }
|
||||
|
||||
fun wasm32(
|
||||
name: String = "wasm32",
|
||||
configure: KotlinNativeTarget.() -> Unit = { }
|
||||
|
||||
+1
-3
@@ -183,11 +183,9 @@ class KotlinMultiplatformPlugin(
|
||||
|
||||
// Note: modifying these sets should also be reflected in the DSL code generator, see 'presetEntries.kt'
|
||||
val nativeTargetsWithHostTests = setOf(LINUX_X64, MACOS_X64, MINGW_X64)
|
||||
val nativeTargetsWithSimulatorTests = setOf(IOS_X64, WATCHOS_X86, TVOS_X64)
|
||||
val disabledNativeTargets = setOf(WATCHOS_X64)
|
||||
val nativeTargetsWithSimulatorTests = setOf(IOS_X64, WATCHOS_X86, WATCHOS_X64, TVOS_X64)
|
||||
|
||||
HostManager().targets
|
||||
.filter { (_, konanTarget) -> konanTarget !in disabledNativeTargets }
|
||||
.forEach { (_, konanTarget) ->
|
||||
val targetToAdd = when (konanTarget) {
|
||||
in nativeTargetsWithHostTests ->
|
||||
|
||||
+1
@@ -514,6 +514,7 @@ class KotlinNativeTargetWithSimulatorTestsConfigurator(kotlinPluginVersion: Stri
|
||||
testTask.deviceId = when (target.konanTarget) {
|
||||
KonanTarget.IOS_X64 -> "iPhone 8"
|
||||
KonanTarget.WATCHOS_X86 -> "Apple Watch Series 5 - 44mm"
|
||||
KonanTarget.WATCHOS_X64 -> "Apple Watch Series 5 - 44mm"
|
||||
KonanTarget.TVOS_X64 -> "Apple TV"
|
||||
else -> error("Simulator tests are not supported for platform ${target.konanTarget.name}")
|
||||
}
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ open class PodspecTask : DefaultTask() {
|
||||
| spec.pod_target_xcconfig = {
|
||||
| 'KOTLIN_TARGET[sdk=iphonesimulator*]' => 'ios_x64',
|
||||
| 'KOTLIN_TARGET[sdk=iphoneos*]' => '$KOTLIN_TARGET_FOR_IOS_DEVICE',
|
||||
| 'KOTLIN_TARGET[sdk=watchsimulator*]' => 'watchos_x86',
|
||||
| 'KOTLIN_TARGET[sdk=watchsimulator*]' => 'watchos_x64',
|
||||
| 'KOTLIN_TARGET[sdk=watchos*]' => '$KOTLIN_TARGET_FOR_WATCHOS_DEVICE',
|
||||
| 'KOTLIN_TARGET[sdk=appletvsimulator*]' => 'tvos_x64',
|
||||
| 'KOTLIN_TARGET[sdk=appletvos*]' => 'tvos_arm64',
|
||||
|
||||
Reference in New Issue
Block a user