Gradle, native: Disable watchOS x64
Currently a 64-bit simulator for watchOS is not available so we disable this target.
This commit is contained in:
+20
-17
@@ -43,26 +43,29 @@ internal val androidPresetEntry = KotlinPresetEntry(
|
||||
typeName("$MPP_PACKAGE.KotlinAndroidTarget")
|
||||
)
|
||||
|
||||
// Note: modifying this set should also be reflected in the MPP plugin code, see 'setupDefaultPresets'
|
||||
// Note: modifying these sets should also be reflected in the MPP plugin code, see 'setupDefaultPresets'
|
||||
private val testableNativeTargets = setOf(KonanTarget.LINUX_X64, KonanTarget.MACOS_X64, KonanTarget.MINGW_X64)
|
||||
private val disabledNativeTargets = setOf(KonanTarget.WATCHOS_X64)
|
||||
|
||||
internal val nativePresetEntries = HostManager().targets.map { (_, target) ->
|
||||
KotlinPresetEntry(
|
||||
target.presetName,
|
||||
typeName(
|
||||
if (target in testableNativeTargets)
|
||||
KOTLIN_NATIVE_TARGET_WITH_TESTS_PRESET_CLASS_FQNAME
|
||||
else
|
||||
KOTLIN_NATIVE_TARGET_PRESET_CLASS_FQNAME
|
||||
),
|
||||
typeName(
|
||||
if (target in testableNativeTargets)
|
||||
KOTLIN_NATIVE_TARGET_WITH_TESTS_CLASS_FQNAME
|
||||
else
|
||||
KOTLIN_NATIVE_TARGET_CLASS_FQNAME
|
||||
internal val nativePresetEntries = HostManager().targets
|
||||
.filter { (_, target) -> target !in disabledNativeTargets }
|
||||
.map { (_, target) ->
|
||||
KotlinPresetEntry(
|
||||
target.presetName,
|
||||
typeName(
|
||||
if (target in testableNativeTargets)
|
||||
KOTLIN_NATIVE_TARGET_WITH_TESTS_PRESET_CLASS_FQNAME
|
||||
else
|
||||
KOTLIN_NATIVE_TARGET_PRESET_CLASS_FQNAME
|
||||
),
|
||||
typeName(
|
||||
if (target in testableNativeTargets)
|
||||
KOTLIN_NATIVE_TARGET_WITH_TESTS_CLASS_FQNAME
|
||||
else
|
||||
KOTLIN_NATIVE_TARGET_CLASS_FQNAME
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
internal val allPresetEntries = listOf(
|
||||
jvmPresetEntry,
|
||||
|
||||
-15
@@ -213,21 +213,6 @@ 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: KotlinNativeTarget.() -> Unit = { }
|
||||
): KotlinNativeTarget =
|
||||
configureOrCreate(
|
||||
name,
|
||||
presets.getByName("watchosX64") as KotlinNativeTargetPreset,
|
||||
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 = { }
|
||||
|
||||
+12
-9
@@ -138,17 +138,20 @@ class KotlinMultiplatformPlugin(
|
||||
add(KotlinAndroidTargetPreset(project, kotlinPluginVersion))
|
||||
add(KotlinJvmWithJavaTargetPreset(project, kotlinPluginVersion))
|
||||
|
||||
// Note: modifying this set should also be reflected in the DSL code generator, see 'presetEntries.kt'
|
||||
// Note: modifying these sets should also be reflected in the DSL code generator, see 'presetEntries.kt'
|
||||
val testableNativeTargets = setOf(KonanTarget.LINUX_X64, KonanTarget.MACOS_X64, KonanTarget.MINGW_X64)
|
||||
val disabledNativeTargets = setOf(KonanTarget.WATCHOS_X64)
|
||||
|
||||
HostManager().targets.forEach { (_, target) ->
|
||||
add(
|
||||
if (target in testableNativeTargets)
|
||||
KotlinNativeTargetWithTestsPreset(target.presetName, project, target, kotlinPluginVersion)
|
||||
else
|
||||
KotlinNativeTargetPreset(target.presetName, project, target, kotlinPluginVersion)
|
||||
)
|
||||
}
|
||||
HostManager().targets
|
||||
.filter { (_, target) -> target !in disabledNativeTargets }
|
||||
.forEach { (_, target) ->
|
||||
add(
|
||||
if (target in testableNativeTargets)
|
||||
KotlinNativeTargetWithTestsPreset(target.presetName, project, target, kotlinPluginVersion)
|
||||
else
|
||||
KotlinNativeTargetPreset(target.presetName, project, target, kotlinPluginVersion)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user