[native] Drop deprecated Kotlin/Native targets (5/8)
Adjust KGP: drop usages of deprecated KonanTargets, leave @Deprecated-stubs in public APIs for readable errors ^KT-64517
This commit is contained in:
committed by
Space Team
parent
4957d99fd6
commit
8f3c0e71fa
+11
-8
@@ -1,7 +1,7 @@
|
||||
package org.jetbrains.kotlin.gradle.plugin
|
||||
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.konan.target.DEPRECATED_TARGET_MESSAGE
|
||||
import org.jetbrains.kotlin.konan.target.REMOVED_TARGET_MESSAGE
|
||||
|
||||
@KotlinTargetsDsl
|
||||
@ExperimentalKotlinGradlePluginApi
|
||||
@@ -150,7 +150,7 @@ interface KotlinHierarchyBuilder {
|
||||
fun withAndroidNativeX86()
|
||||
fun withAndroidNativeArm32()
|
||||
fun withAndroidNativeArm64()
|
||||
fun withIosArm32()
|
||||
|
||||
fun withIosArm64()
|
||||
fun withIosX64()
|
||||
fun withIosSimulatorArm64()
|
||||
@@ -168,21 +168,24 @@ interface KotlinHierarchyBuilder {
|
||||
fun withMacosArm64()
|
||||
fun withLinuxArm64()
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
@Deprecated(message = REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
fun withIosArm32()
|
||||
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
fun withWatchosX86()
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
fun withMingwX86()
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
fun withLinuxArm32Hfp()
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
fun withLinuxMips32()
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
fun withLinuxMipsel32()
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
fun withWasm32()
|
||||
}
|
||||
|
||||
+3
-7
@@ -52,16 +52,12 @@ enum class NativeOutputKind(
|
||||
CompilerOutputKind.DYNAMIC,
|
||||
"shared",
|
||||
description = "a dynamic library"
|
||||
) {
|
||||
override fun availableFor(target: KonanTarget) = target != KonanTarget.WASM32
|
||||
},
|
||||
),
|
||||
STATIC(
|
||||
CompilerOutputKind.STATIC,
|
||||
"static",
|
||||
description = "a static library"
|
||||
) {
|
||||
override fun availableFor(target: KonanTarget) = target != KonanTarget.WASM32
|
||||
},
|
||||
),
|
||||
FRAMEWORK(
|
||||
CompilerOutputKind.FRAMEWORK,
|
||||
"framework",
|
||||
@@ -83,4 +79,4 @@ enum class BitcodeEmbeddingMode {
|
||||
|
||||
/** Embed placeholder LLVM IR data as a marker. */
|
||||
MARKER,
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -91,7 +91,6 @@ private val nativeTargetsWithSimulatorTests =
|
||||
KonanTarget.IOS_X64,
|
||||
KonanTarget.IOS_SIMULATOR_ARM64,
|
||||
|
||||
KonanTarget.WATCHOS_X86,
|
||||
KonanTarget.WATCHOS_X64,
|
||||
KonanTarget.WATCHOS_SIMULATOR_ARM64,
|
||||
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractKotlinNativeTargetPreset
|
||||
import org.jetbrains.kotlin.konan.target.HostManager.Companion.hostIsLinux
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget.LINUX_MIPS32
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
|
||||
+15
-27
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
||||
import org.jetbrains.kotlin.konan.target.DEPRECATED_TARGET_MESSAGE
|
||||
import org.jetbrains.kotlin.konan.target.Family
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||
import org.jetbrains.kotlin.konan.target.REMOVED_TARGET_MESSAGE
|
||||
import org.jetbrains.kotlin.tooling.core.closure
|
||||
|
||||
|
||||
@@ -192,9 +193,8 @@ private class KotlinHierarchyBuilderImpl(
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.ANDROID_ARM64
|
||||
}
|
||||
|
||||
override fun withIosArm32() = withTargets {
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.IOS_ARM32
|
||||
}
|
||||
@Deprecated(message = REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withIosArm32() = Unit
|
||||
|
||||
override fun withIosArm64() = withTargets {
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.IOS_ARM64
|
||||
@@ -260,35 +260,23 @@ private class KotlinHierarchyBuilderImpl(
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_ARM64
|
||||
}
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withWatchosX86() = withTargets {
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.WATCHOS_X86
|
||||
}
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withWatchosX86() = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withMingwX86() = withTargets {
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.MINGW_X86
|
||||
}
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withMingwX86() = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withLinuxArm32Hfp() = withTargets {
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_ARM32_HFP
|
||||
}
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withLinuxArm32Hfp() = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withLinuxMips32() = withTargets {
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_MIPS32
|
||||
}
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withLinuxMips32() = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withLinuxMipsel32() = withTargets {
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_MIPSEL32
|
||||
}
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withLinuxMipsel32() = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withWasm32() = withTargets {
|
||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.WASM32
|
||||
}
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
override fun withWasm32() = Unit
|
||||
|
||||
override fun toString(): String {
|
||||
return "KotlinHierarchyBuilder($node)"
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ internal val KotlinMultiplatformTargetPresetAction = KotlinProjectSetupAction {
|
||||
val nativeTargetsWithHostTests = setOf(LINUX_X64, MACOS_X64, MACOS_ARM64, MINGW_X64)
|
||||
val nativeTargetsWithSimulatorTests = setOf(
|
||||
IOS_X64, IOS_SIMULATOR_ARM64,
|
||||
WATCHOS_X86, WATCHOS_X64, WATCHOS_SIMULATOR_ARM64,
|
||||
WATCHOS_X64, WATCHOS_SIMULATOR_ARM64,
|
||||
TVOS_X64, TVOS_SIMULATOR_ARM64
|
||||
)
|
||||
|
||||
|
||||
+1
-3
@@ -19,7 +19,6 @@ internal object AppleSdk {
|
||||
targets.addAll(archs.map { arch ->
|
||||
when (arch) {
|
||||
"arm64", "arm64e" -> KonanTarget.IOS_ARM64
|
||||
"armv7", "armv7s" -> KonanTarget.IOS_ARM32
|
||||
else -> throw UnknownArchitectureException(platform, arch)
|
||||
}
|
||||
})
|
||||
@@ -47,7 +46,6 @@ internal object AppleSdk {
|
||||
targets.addAll(archs.map { arch ->
|
||||
when (arch) {
|
||||
"arm64", "arm64e" -> KonanTarget.WATCHOS_SIMULATOR_ARM64
|
||||
"i386" -> KonanTarget.WATCHOS_X86
|
||||
"x86_64" -> KonanTarget.WATCHOS_X64
|
||||
else -> throw UnknownArchitectureException(platform, arch)
|
||||
}
|
||||
@@ -84,4 +82,4 @@ internal object AppleSdk {
|
||||
|
||||
return targets.toList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -35,10 +35,10 @@ internal enum class AppleTarget(
|
||||
val targets: List<KonanTarget>
|
||||
) {
|
||||
MACOS_DEVICE("macos", listOf(KonanTarget.MACOS_X64, KonanTarget.MACOS_ARM64)),
|
||||
IPHONE_DEVICE("ios", listOf(KonanTarget.IOS_ARM32, KonanTarget.IOS_ARM64)),
|
||||
IPHONE_DEVICE("ios", listOf(KonanTarget.IOS_ARM64)),
|
||||
IPHONE_SIMULATOR("iosSimulator", listOf(KonanTarget.IOS_X64, KonanTarget.IOS_SIMULATOR_ARM64)),
|
||||
WATCHOS_DEVICE("watchos", listOf(KonanTarget.WATCHOS_ARM32, KonanTarget.WATCHOS_ARM64, KonanTarget.WATCHOS_DEVICE_ARM64)),
|
||||
WATCHOS_SIMULATOR("watchosSimulator", listOf(KonanTarget.WATCHOS_X86, KonanTarget.WATCHOS_X64, KonanTarget.WATCHOS_SIMULATOR_ARM64)),
|
||||
WATCHOS_SIMULATOR("watchosSimulator", listOf(KonanTarget.WATCHOS_X64, KonanTarget.WATCHOS_SIMULATOR_ARM64)),
|
||||
TVOS_DEVICE("tvos", listOf(KonanTarget.TVOS_ARM64)),
|
||||
TVOS_SIMULATOR("tvosSimulator", listOf(KonanTarget.TVOS_X64, KonanTarget.TVOS_SIMULATOR_ARM64))
|
||||
}
|
||||
@@ -311,4 +311,4 @@ internal constructor(
|
||||
|
||||
private fun Directory.dirIfNotNull(relative: String?): Directory = if (relative == null) this else this.dir(relative)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -114,8 +114,8 @@ private fun String.toBuildDependenciesTaskName(pod: CocoapodsDependency): String
|
||||
private val KotlinNativeTarget.toValidSDK: String
|
||||
get() = when (konanTarget) {
|
||||
IOS_X64, IOS_SIMULATOR_ARM64 -> "iphonesimulator"
|
||||
IOS_ARM32, IOS_ARM64 -> "iphoneos"
|
||||
WATCHOS_X86, WATCHOS_X64, WATCHOS_SIMULATOR_ARM64 -> "watchsimulator"
|
||||
IOS_ARM64 -> "iphoneos"
|
||||
WATCHOS_X64, WATCHOS_SIMULATOR_ARM64 -> "watchsimulator"
|
||||
WATCHOS_ARM32, WATCHOS_ARM64, WATCHOS_DEVICE_ARM64 -> "watchos"
|
||||
TVOS_X64, TVOS_SIMULATOR_ARM64 -> "appletvsimulator"
|
||||
TVOS_ARM64 -> "appletvos"
|
||||
|
||||
+1
-2
@@ -340,8 +340,7 @@ constructor(
|
||||
when {
|
||||
outputKind == CompilerOutputKind.FRAMEWORK ->
|
||||
it.asValidFrameworkName()
|
||||
outputKind in listOf(CompilerOutputKind.STATIC, CompilerOutputKind.DYNAMIC) ||
|
||||
outputKind == CompilerOutputKind.PROGRAM && konanTarget == KonanTarget.WASM32 ->
|
||||
outputKind in listOf(CompilerOutputKind.STATIC, CompilerOutputKind.DYNAMIC) ->
|
||||
it.replace('-', '_')
|
||||
else -> it
|
||||
}
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ abstract class AbstractKotlinNativeCompile<
|
||||
outputKind == FRAMEWORK ->
|
||||
it.asValidFrameworkName()
|
||||
|
||||
outputKind in listOf(STATIC, DYNAMIC) || outputKind == PROGRAM && konanTarget == KonanTarget.WASM32 ->
|
||||
outputKind in listOf(STATIC, DYNAMIC) ->
|
||||
it.replace('-', '_')
|
||||
|
||||
else -> it
|
||||
|
||||
+16
-17
@@ -6,8 +6,8 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinArtifactConfig
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinArtifactsExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
|
||||
import org.jetbrains.kotlin.konan.target.DEPRECATED_TARGET_MESSAGE
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||
import org.jetbrains.kotlin.konan.target.REMOVED_TARGET_MESSAGE
|
||||
import javax.inject.Inject
|
||||
|
||||
// DO NOT EDIT MANUALLY! Generated by org.jetbrains.kotlin.generators.gradle.dsl.KotlinArtifactsDSLCodegenKt
|
||||
@@ -52,25 +52,24 @@ abstract class KotlinArtifactsExtensionImpl @Inject constructor(project: Project
|
||||
val linuxArm64 = KonanTarget.LINUX_ARM64
|
||||
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val iosArm32 = KonanTarget.IOS_ARM32
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val iosArm32 = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val watchosX86 = KonanTarget.WATCHOS_X86
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val watchosX86 = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val mingwX86 = KonanTarget.MINGW_X86
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val mingwX86 = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val linuxArm32Hfp = KonanTarget.LINUX_ARM32_HFP
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val linuxArm32Hfp = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val linuxMips32 = KonanTarget.LINUX_MIPS32
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val linuxMips32 = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val linuxMipsel32 = KonanTarget.LINUX_MIPSEL32
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val linuxMipsel32 = Unit
|
||||
|
||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val wasm32 = KonanTarget.WASM32
|
||||
|
||||
}
|
||||
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||
val wasm32 = Unit
|
||||
}
|
||||
|
||||
-6
@@ -32,13 +32,11 @@ enum class StringMetrics(val type: StringOverridePolicy, val anonymization: Stri
|
||||
"androidJvm",
|
||||
"android_arm32",
|
||||
"android_arm64",
|
||||
"ios_arm32",
|
||||
"ios_arm64",
|
||||
"ios_simulator_arm64",
|
||||
"ios_x64",
|
||||
"watchos_arm32",
|
||||
"watchos_arm64",
|
||||
"watchos_x86",
|
||||
"watchos_x64",
|
||||
"watchos_simulator_arm64",
|
||||
"watchos_device_arm64",
|
||||
@@ -46,15 +44,11 @@ enum class StringMetrics(val type: StringOverridePolicy, val anonymization: Stri
|
||||
"tvos_x64",
|
||||
"tvos_simulator_arm64",
|
||||
"linux_arm32_hfp",
|
||||
"linux_mips32",
|
||||
"linux_mipsel32",
|
||||
"linux_arm64",
|
||||
"linux_x64",
|
||||
"macos_x64",
|
||||
"macos_arm64",
|
||||
"mingw_x64",
|
||||
"mingw_x86",
|
||||
"wasm32",
|
||||
"wasm"
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user