[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
|
package org.jetbrains.kotlin.gradle.plugin
|
||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
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
|
@KotlinTargetsDsl
|
||||||
@ExperimentalKotlinGradlePluginApi
|
@ExperimentalKotlinGradlePluginApi
|
||||||
@@ -150,7 +150,7 @@ interface KotlinHierarchyBuilder {
|
|||||||
fun withAndroidNativeX86()
|
fun withAndroidNativeX86()
|
||||||
fun withAndroidNativeArm32()
|
fun withAndroidNativeArm32()
|
||||||
fun withAndroidNativeArm64()
|
fun withAndroidNativeArm64()
|
||||||
fun withIosArm32()
|
|
||||||
fun withIosArm64()
|
fun withIosArm64()
|
||||||
fun withIosX64()
|
fun withIosX64()
|
||||||
fun withIosSimulatorArm64()
|
fun withIosSimulatorArm64()
|
||||||
@@ -168,21 +168,24 @@ interface KotlinHierarchyBuilder {
|
|||||||
fun withMacosArm64()
|
fun withMacosArm64()
|
||||||
fun withLinuxArm64()
|
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()
|
fun withWatchosX86()
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
fun withMingwX86()
|
fun withMingwX86()
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
fun withLinuxArm32Hfp()
|
fun withLinuxArm32Hfp()
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
fun withLinuxMips32()
|
fun withLinuxMips32()
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
fun withLinuxMipsel32()
|
fun withLinuxMipsel32()
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
fun withWasm32()
|
fun withWasm32()
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-7
@@ -52,16 +52,12 @@ enum class NativeOutputKind(
|
|||||||
CompilerOutputKind.DYNAMIC,
|
CompilerOutputKind.DYNAMIC,
|
||||||
"shared",
|
"shared",
|
||||||
description = "a dynamic library"
|
description = "a dynamic library"
|
||||||
) {
|
),
|
||||||
override fun availableFor(target: KonanTarget) = target != KonanTarget.WASM32
|
|
||||||
},
|
|
||||||
STATIC(
|
STATIC(
|
||||||
CompilerOutputKind.STATIC,
|
CompilerOutputKind.STATIC,
|
||||||
"static",
|
"static",
|
||||||
description = "a static library"
|
description = "a static library"
|
||||||
) {
|
),
|
||||||
override fun availableFor(target: KonanTarget) = target != KonanTarget.WASM32
|
|
||||||
},
|
|
||||||
FRAMEWORK(
|
FRAMEWORK(
|
||||||
CompilerOutputKind.FRAMEWORK,
|
CompilerOutputKind.FRAMEWORK,
|
||||||
"framework",
|
"framework",
|
||||||
@@ -83,4 +79,4 @@ enum class BitcodeEmbeddingMode {
|
|||||||
|
|
||||||
/** Embed placeholder LLVM IR data as a marker. */
|
/** Embed placeholder LLVM IR data as a marker. */
|
||||||
MARKER,
|
MARKER,
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -91,7 +91,6 @@ private val nativeTargetsWithSimulatorTests =
|
|||||||
KonanTarget.IOS_X64,
|
KonanTarget.IOS_X64,
|
||||||
KonanTarget.IOS_SIMULATOR_ARM64,
|
KonanTarget.IOS_SIMULATOR_ARM64,
|
||||||
|
|
||||||
KonanTarget.WATCHOS_X86,
|
|
||||||
KonanTarget.WATCHOS_X64,
|
KonanTarget.WATCHOS_X64,
|
||||||
KonanTarget.WATCHOS_SIMULATOR_ARM64,
|
KonanTarget.WATCHOS_SIMULATOR_ARM64,
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,6 +1,5 @@
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractKotlinNativeTargetPreset
|
import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractKotlinNativeTargetPreset
|
||||||
import org.jetbrains.kotlin.konan.target.HostManager.Companion.hostIsLinux
|
import org.jetbrains.kotlin.konan.target.HostManager.Companion.hostIsLinux
|
||||||
import org.jetbrains.kotlin.konan.target.KonanTarget.LINUX_MIPS32
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
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.DEPRECATED_TARGET_MESSAGE
|
||||||
import org.jetbrains.kotlin.konan.target.Family
|
import org.jetbrains.kotlin.konan.target.Family
|
||||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||||
|
import org.jetbrains.kotlin.konan.target.REMOVED_TARGET_MESSAGE
|
||||||
import org.jetbrains.kotlin.tooling.core.closure
|
import org.jetbrains.kotlin.tooling.core.closure
|
||||||
|
|
||||||
|
|
||||||
@@ -192,9 +193,8 @@ private class KotlinHierarchyBuilderImpl(
|
|||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.ANDROID_ARM64
|
it is KotlinNativeTarget && it.konanTarget == KonanTarget.ANDROID_ARM64
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun withIosArm32() = withTargets {
|
@Deprecated(message = REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.IOS_ARM32
|
override fun withIosArm32() = Unit
|
||||||
}
|
|
||||||
|
|
||||||
override fun withIosArm64() = withTargets {
|
override fun withIosArm64() = withTargets {
|
||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.IOS_ARM64
|
it is KotlinNativeTarget && it.konanTarget == KonanTarget.IOS_ARM64
|
||||||
@@ -260,35 +260,23 @@ private class KotlinHierarchyBuilderImpl(
|
|||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_ARM64
|
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_ARM64
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
override fun withWatchosX86() = withTargets {
|
override fun withWatchosX86() = Unit
|
||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.WATCHOS_X86
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
override fun withMingwX86() = withTargets {
|
override fun withMingwX86() = Unit
|
||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.MINGW_X86
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
override fun withLinuxArm32Hfp() = withTargets {
|
override fun withLinuxArm32Hfp() = Unit
|
||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_ARM32_HFP
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
override fun withLinuxMips32() = withTargets {
|
override fun withLinuxMips32() = Unit
|
||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_MIPS32
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
override fun withLinuxMipsel32() = withTargets {
|
override fun withLinuxMipsel32() = Unit
|
||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.LINUX_MIPSEL32
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
override fun withWasm32() = withTargets {
|
override fun withWasm32() = Unit
|
||||||
it is KotlinNativeTarget && it.konanTarget == KonanTarget.WASM32
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "KotlinHierarchyBuilder($node)"
|
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 nativeTargetsWithHostTests = setOf(LINUX_X64, MACOS_X64, MACOS_ARM64, MINGW_X64)
|
||||||
val nativeTargetsWithSimulatorTests = setOf(
|
val nativeTargetsWithSimulatorTests = setOf(
|
||||||
IOS_X64, IOS_SIMULATOR_ARM64,
|
IOS_X64, IOS_SIMULATOR_ARM64,
|
||||||
WATCHOS_X86, WATCHOS_X64, WATCHOS_SIMULATOR_ARM64,
|
WATCHOS_X64, WATCHOS_SIMULATOR_ARM64,
|
||||||
TVOS_X64, TVOS_SIMULATOR_ARM64
|
TVOS_X64, TVOS_SIMULATOR_ARM64
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -19,7 +19,6 @@ internal object AppleSdk {
|
|||||||
targets.addAll(archs.map { arch ->
|
targets.addAll(archs.map { arch ->
|
||||||
when (arch) {
|
when (arch) {
|
||||||
"arm64", "arm64e" -> KonanTarget.IOS_ARM64
|
"arm64", "arm64e" -> KonanTarget.IOS_ARM64
|
||||||
"armv7", "armv7s" -> KonanTarget.IOS_ARM32
|
|
||||||
else -> throw UnknownArchitectureException(platform, arch)
|
else -> throw UnknownArchitectureException(platform, arch)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -47,7 +46,6 @@ internal object AppleSdk {
|
|||||||
targets.addAll(archs.map { arch ->
|
targets.addAll(archs.map { arch ->
|
||||||
when (arch) {
|
when (arch) {
|
||||||
"arm64", "arm64e" -> KonanTarget.WATCHOS_SIMULATOR_ARM64
|
"arm64", "arm64e" -> KonanTarget.WATCHOS_SIMULATOR_ARM64
|
||||||
"i386" -> KonanTarget.WATCHOS_X86
|
|
||||||
"x86_64" -> KonanTarget.WATCHOS_X64
|
"x86_64" -> KonanTarget.WATCHOS_X64
|
||||||
else -> throw UnknownArchitectureException(platform, arch)
|
else -> throw UnknownArchitectureException(platform, arch)
|
||||||
}
|
}
|
||||||
@@ -84,4 +82,4 @@ internal object AppleSdk {
|
|||||||
|
|
||||||
return targets.toList()
|
return targets.toList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -35,10 +35,10 @@ internal enum class AppleTarget(
|
|||||||
val targets: List<KonanTarget>
|
val targets: List<KonanTarget>
|
||||||
) {
|
) {
|
||||||
MACOS_DEVICE("macos", listOf(KonanTarget.MACOS_X64, KonanTarget.MACOS_ARM64)),
|
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)),
|
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_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_DEVICE("tvos", listOf(KonanTarget.TVOS_ARM64)),
|
||||||
TVOS_SIMULATOR("tvosSimulator", listOf(KonanTarget.TVOS_X64, KonanTarget.TVOS_SIMULATOR_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)
|
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
|
private val KotlinNativeTarget.toValidSDK: String
|
||||||
get() = when (konanTarget) {
|
get() = when (konanTarget) {
|
||||||
IOS_X64, IOS_SIMULATOR_ARM64 -> "iphonesimulator"
|
IOS_X64, IOS_SIMULATOR_ARM64 -> "iphonesimulator"
|
||||||
IOS_ARM32, IOS_ARM64 -> "iphoneos"
|
IOS_ARM64 -> "iphoneos"
|
||||||
WATCHOS_X86, WATCHOS_X64, WATCHOS_SIMULATOR_ARM64 -> "watchsimulator"
|
WATCHOS_X64, WATCHOS_SIMULATOR_ARM64 -> "watchsimulator"
|
||||||
WATCHOS_ARM32, WATCHOS_ARM64, WATCHOS_DEVICE_ARM64 -> "watchos"
|
WATCHOS_ARM32, WATCHOS_ARM64, WATCHOS_DEVICE_ARM64 -> "watchos"
|
||||||
TVOS_X64, TVOS_SIMULATOR_ARM64 -> "appletvsimulator"
|
TVOS_X64, TVOS_SIMULATOR_ARM64 -> "appletvsimulator"
|
||||||
TVOS_ARM64 -> "appletvos"
|
TVOS_ARM64 -> "appletvos"
|
||||||
|
|||||||
+1
-2
@@ -340,8 +340,7 @@ constructor(
|
|||||||
when {
|
when {
|
||||||
outputKind == CompilerOutputKind.FRAMEWORK ->
|
outputKind == CompilerOutputKind.FRAMEWORK ->
|
||||||
it.asValidFrameworkName()
|
it.asValidFrameworkName()
|
||||||
outputKind in listOf(CompilerOutputKind.STATIC, CompilerOutputKind.DYNAMIC) ||
|
outputKind in listOf(CompilerOutputKind.STATIC, CompilerOutputKind.DYNAMIC) ->
|
||||||
outputKind == CompilerOutputKind.PROGRAM && konanTarget == KonanTarget.WASM32 ->
|
|
||||||
it.replace('-', '_')
|
it.replace('-', '_')
|
||||||
else -> it
|
else -> it
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -226,7 +226,7 @@ abstract class AbstractKotlinNativeCompile<
|
|||||||
outputKind == FRAMEWORK ->
|
outputKind == FRAMEWORK ->
|
||||||
it.asValidFrameworkName()
|
it.asValidFrameworkName()
|
||||||
|
|
||||||
outputKind in listOf(STATIC, DYNAMIC) || outputKind == PROGRAM && konanTarget == KonanTarget.WASM32 ->
|
outputKind in listOf(STATIC, DYNAMIC) ->
|
||||||
it.replace('-', '_')
|
it.replace('-', '_')
|
||||||
|
|
||||||
else -> it
|
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.dsl.KotlinArtifactsExtension
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode
|
import org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
|
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.KonanTarget
|
||||||
|
import org.jetbrains.kotlin.konan.target.REMOVED_TARGET_MESSAGE
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
// DO NOT EDIT MANUALLY! Generated by org.jetbrains.kotlin.generators.gradle.dsl.KotlinArtifactsDSLCodegenKt
|
// 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
|
val linuxArm64 = KonanTarget.LINUX_ARM64
|
||||||
|
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
val iosArm32 = KonanTarget.IOS_ARM32
|
val iosArm32 = Unit
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
val watchosX86 = KonanTarget.WATCHOS_X86
|
val watchosX86 = Unit
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
val mingwX86 = KonanTarget.MINGW_X86
|
val mingwX86 = Unit
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
val linuxArm32Hfp = KonanTarget.LINUX_ARM32_HFP
|
val linuxArm32Hfp = Unit
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
val linuxMips32 = KonanTarget.LINUX_MIPS32
|
val linuxMips32 = Unit
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
val linuxMipsel32 = KonanTarget.LINUX_MIPSEL32
|
val linuxMipsel32 = Unit
|
||||||
|
|
||||||
@Deprecated(DEPRECATED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
@Deprecated(REMOVED_TARGET_MESSAGE, level = DeprecationLevel.ERROR)
|
||||||
val wasm32 = KonanTarget.WASM32
|
val wasm32 = Unit
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
-6
@@ -32,13 +32,11 @@ enum class StringMetrics(val type: StringOverridePolicy, val anonymization: Stri
|
|||||||
"androidJvm",
|
"androidJvm",
|
||||||
"android_arm32",
|
"android_arm32",
|
||||||
"android_arm64",
|
"android_arm64",
|
||||||
"ios_arm32",
|
|
||||||
"ios_arm64",
|
"ios_arm64",
|
||||||
"ios_simulator_arm64",
|
"ios_simulator_arm64",
|
||||||
"ios_x64",
|
"ios_x64",
|
||||||
"watchos_arm32",
|
"watchos_arm32",
|
||||||
"watchos_arm64",
|
"watchos_arm64",
|
||||||
"watchos_x86",
|
|
||||||
"watchos_x64",
|
"watchos_x64",
|
||||||
"watchos_simulator_arm64",
|
"watchos_simulator_arm64",
|
||||||
"watchos_device_arm64",
|
"watchos_device_arm64",
|
||||||
@@ -46,15 +44,11 @@ enum class StringMetrics(val type: StringOverridePolicy, val anonymization: Stri
|
|||||||
"tvos_x64",
|
"tvos_x64",
|
||||||
"tvos_simulator_arm64",
|
"tvos_simulator_arm64",
|
||||||
"linux_arm32_hfp",
|
"linux_arm32_hfp",
|
||||||
"linux_mips32",
|
|
||||||
"linux_mipsel32",
|
|
||||||
"linux_arm64",
|
"linux_arm64",
|
||||||
"linux_x64",
|
"linux_x64",
|
||||||
"macos_x64",
|
"macos_x64",
|
||||||
"macos_arm64",
|
"macos_arm64",
|
||||||
"mingw_x64",
|
"mingw_x64",
|
||||||
"mingw_x86",
|
|
||||||
"wasm32",
|
|
||||||
"wasm"
|
"wasm"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ public class CommonizeNativeDistributionTest {
|
|||||||
LINUX_X64, LINUX_ARM64,
|
LINUX_X64, LINUX_ARM64,
|
||||||
MACOS_X64, MACOS_ARM64,
|
MACOS_X64, MACOS_ARM64,
|
||||||
IOS_X64, IOS_ARM64,
|
IOS_X64, IOS_ARM64,
|
||||||
WATCHOS_ARM64, WATCHOS_ARM32, WATCHOS_X86, WATCHOS_DEVICE_ARM64,
|
WATCHOS_ARM64, WATCHOS_ARM32, WATCHOS_DEVICE_ARM64,
|
||||||
TVOS_ARM64, TVOS_X64
|
TVOS_ARM64, TVOS_X64
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -19,13 +19,11 @@ enum class PlatformIntWidth {
|
|||||||
|
|
||||||
object PlatformWidthIndex {
|
object PlatformWidthIndex {
|
||||||
private val widthByLeafTargets = mapOf(
|
private val widthByLeafTargets = mapOf(
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_ARM32) to PlatformIntWidth.INT,
|
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_ARM64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.IOS_ARM64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_X64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.IOS_X64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_SIMULATOR_ARM64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.IOS_SIMULATOR_ARM64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.WATCHOS_ARM32) to PlatformIntWidth.INT,
|
LeafCommonizerTarget(KonanTarget.WATCHOS_ARM32) to PlatformIntWidth.INT,
|
||||||
LeafCommonizerTarget(KonanTarget.WATCHOS_ARM64) to PlatformIntWidth.INT,
|
LeafCommonizerTarget(KonanTarget.WATCHOS_ARM64) to PlatformIntWidth.INT,
|
||||||
LeafCommonizerTarget(KonanTarget.WATCHOS_X86) to PlatformIntWidth.INT,
|
|
||||||
LeafCommonizerTarget(KonanTarget.WATCHOS_X64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.WATCHOS_X64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.WATCHOS_SIMULATOR_ARM64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.WATCHOS_SIMULATOR_ARM64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.WATCHOS_DEVICE_ARM64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.WATCHOS_DEVICE_ARM64) to PlatformIntWidth.LONG,
|
||||||
@@ -33,15 +31,11 @@ object PlatformWidthIndex {
|
|||||||
LeafCommonizerTarget(KonanTarget.TVOS_X64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.TVOS_X64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.TVOS_SIMULATOR_ARM64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.TVOS_SIMULATOR_ARM64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.LINUX_X64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.LINUX_X64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.MINGW_X86) to PlatformIntWidth.INT,
|
|
||||||
LeafCommonizerTarget(KonanTarget.MINGW_X64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.MINGW_X64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.MACOS_X64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.MACOS_X64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.MACOS_ARM64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.MACOS_ARM64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.LINUX_ARM64) to PlatformIntWidth.LONG,
|
LeafCommonizerTarget(KonanTarget.LINUX_ARM64) to PlatformIntWidth.LONG,
|
||||||
LeafCommonizerTarget(KonanTarget.LINUX_ARM32_HFP) to PlatformIntWidth.INT,
|
LeafCommonizerTarget(KonanTarget.LINUX_ARM32_HFP) to PlatformIntWidth.INT,
|
||||||
LeafCommonizerTarget(KonanTarget.LINUX_MIPS32) to PlatformIntWidth.INT,
|
|
||||||
LeafCommonizerTarget(KonanTarget.LINUX_MIPSEL32) to PlatformIntWidth.INT,
|
|
||||||
LeafCommonizerTarget(KonanTarget.WASM32) to PlatformIntWidth.INT,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
fun platformWidthOf(target: CommonizerTarget): PlatformIntWidth? {
|
fun platformWidthOf(target: CommonizerTarget): PlatformIntWidth? {
|
||||||
@@ -56,4 +50,3 @@ object PlatformWidthIndex {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class PlatformBitWidthTest {
|
|||||||
fun `test leaf int`() {
|
fun `test leaf int`() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
PlatformIntWidth.INT,
|
PlatformIntWidth.INT,
|
||||||
createPlatformBitWidthIndex().platformWidthOf(CommonizerTarget(KonanTarget.IOS_ARM32))
|
createPlatformBitWidthIndex().platformWidthOf(CommonizerTarget(KonanTarget.WATCHOS_ARM32))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ class PlatformBitWidthTest {
|
|||||||
fun `test shared int`() {
|
fun `test shared int`() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
PlatformIntWidth.INT,
|
PlatformIntWidth.INT,
|
||||||
createPlatformBitWidthIndex().platformWidthOf(CommonizerTarget(KonanTarget.IOS_ARM32, KonanTarget.LINUX_MIPS32))
|
createPlatformBitWidthIndex().platformWidthOf(CommonizerTarget(KonanTarget.WATCHOS_ARM32, KonanTarget.LINUX_ARM32_HFP))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ class PlatformBitWidthTest {
|
|||||||
fun `test int and long`() {
|
fun `test int and long`() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
PlatformIntWidth.MIXED,
|
PlatformIntWidth.MIXED,
|
||||||
createPlatformBitWidthIndex().platformWidthOf(CommonizerTarget(KonanTarget.IOS_ARM32, KonanTarget.MACOS_X64))
|
createPlatformBitWidthIndex().platformWidthOf(CommonizerTarget(KonanTarget.WATCHOS_ARM32, KonanTarget.MACOS_X64))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ class PlatformBitWidthTest {
|
|||||||
null,
|
null,
|
||||||
createPlatformBitWidthIndex().platformWidthOf(
|
createPlatformBitWidthIndex().platformWidthOf(
|
||||||
CommonizerTarget(
|
CommonizerTarget(
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_ARM32),
|
LeafCommonizerTarget(KonanTarget.WATCHOS_ARM32),
|
||||||
LeafCommonizerTarget("unknown_target")
|
LeafCommonizerTarget("unknown_target")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -87,7 +87,7 @@ class PlatformBitWidthTest {
|
|||||||
createPlatformBitWidthIndex().platformWidthOf(
|
createPlatformBitWidthIndex().platformWidthOf(
|
||||||
CommonizerTarget(
|
CommonizerTarget(
|
||||||
LeafCommonizerTarget(KonanTarget.MACOS_X64),
|
LeafCommonizerTarget(KonanTarget.MACOS_X64),
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_ARM32),
|
LeafCommonizerTarget(KonanTarget.WATCHOS_ARM32),
|
||||||
LeafCommonizerTarget("unknown_target"),
|
LeafCommonizerTarget("unknown_target"),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ class RootCommonizerTest : AbstractCommonizerTest<CirRoot, CirRoot>() {
|
|||||||
setOf(
|
setOf(
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_X64),
|
LeafCommonizerTarget(KonanTarget.IOS_X64),
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_ARM64),
|
LeafCommonizerTarget(KonanTarget.IOS_ARM64),
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_ARM32)
|
LeafCommonizerTarget(KonanTarget.WATCHOS_ARM32)
|
||||||
)
|
)
|
||||||
).toMock(),
|
).toMock(),
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_X64).toMock(),
|
LeafCommonizerTarget(KonanTarget.IOS_X64).toMock(),
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_ARM64).toMock(),
|
LeafCommonizerTarget(KonanTarget.IOS_ARM64).toMock(),
|
||||||
LeafCommonizerTarget(KonanTarget.IOS_ARM32).toMock()
|
LeafCommonizerTarget(KonanTarget.WATCHOS_ARM32).toMock()
|
||||||
)
|
)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+29
-73
@@ -438,19 +438,15 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
|
|
||||||
fun `test platform integers in multi-target commonization`() {
|
fun `test platform integers in multi-target commonization`() {
|
||||||
val intTarget1 = LINUX_ARM32_HFP.name
|
val intTarget1 = LINUX_ARM32_HFP.name
|
||||||
val intTarget2 = LINUX_MIPS32.name
|
val intTarget2 = WATCHOS_ARM64.name
|
||||||
val intTarget3 = LINUX_MIPSEL32.name
|
|
||||||
val longTarget1 = LINUX_X64.name
|
val longTarget1 = LINUX_X64.name
|
||||||
val longTarget2 = LINUX_ARM64.name
|
val longTarget2 = LINUX_ARM64.name
|
||||||
val longTarget3 = MACOS_X64.name
|
|
||||||
|
|
||||||
val outputCommonizerTargets = arrayOf(
|
val outputCommonizerTargets = arrayOf(
|
||||||
"($intTarget1, $intTarget2)", "($longTarget1, $longTarget2)", "($intTarget3, $longTarget3)",
|
"($intTarget1, $intTarget2)", "($longTarget1, $longTarget2)", "($intTarget1, $longTarget1)",
|
||||||
"($intTarget1, $intTarget2, $intTarget3)", "($longTarget1, $longTarget2, $longTarget3)",
|
"($intTarget1, $intTarget2, $longTarget1)",
|
||||||
"($intTarget1, $intTarget2, $intTarget3, $longTarget1)",
|
"($longTarget1, $longTarget2, $intTarget1)",
|
||||||
"($intTarget1, $intTarget2, $longTarget1, $longTarget2)",
|
"($intTarget1, $intTarget2, $longTarget1, $longTarget2)",
|
||||||
"($longTarget1, $longTarget2, $longTarget3, $intTarget1)",
|
|
||||||
"($intTarget1, $intTarget2, $intTarget3, $longTarget1, $longTarget2, $longTarget3)",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
@@ -472,13 +468,6 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
typealias XV = IntVarOf<X>
|
typealias XV = IntVarOf<X>
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
intTarget3 withSource """
|
|
||||||
import kotlinx.cinterop.*
|
|
||||||
|
|
||||||
typealias X = Int
|
|
||||||
typealias XV = IntVarOf<X>
|
|
||||||
""".trimIndent()
|
|
||||||
|
|
||||||
longTarget1 withSource """
|
longTarget1 withSource """
|
||||||
import kotlinx.cinterop.*
|
import kotlinx.cinterop.*
|
||||||
|
|
||||||
@@ -493,12 +482,6 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
typealias XV = LongVarOf<X>
|
typealias XV = LongVarOf<X>
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
longTarget3 withSource """
|
|
||||||
import kotlinx.cinterop.*
|
|
||||||
|
|
||||||
typealias X = Long
|
|
||||||
typealias XV = LongVarOf<X>
|
|
||||||
""".trimIndent()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result.assertCommonized(
|
result.assertCommonized(
|
||||||
@@ -510,15 +493,6 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
|
|
||||||
result.assertCommonized(
|
|
||||||
"($intTarget1, $intTarget2, $intTarget3)", """
|
|
||||||
import kotlinx.cinterop.*
|
|
||||||
|
|
||||||
typealias X = Int
|
|
||||||
typealias XV = IntVarOf<X>
|
|
||||||
""".trimIndent()
|
|
||||||
)
|
|
||||||
|
|
||||||
result.assertCommonized(
|
result.assertCommonized(
|
||||||
"($longTarget1, $longTarget2)", """
|
"($longTarget1, $longTarget2)", """
|
||||||
import kotlinx.cinterop.*
|
import kotlinx.cinterop.*
|
||||||
@@ -529,16 +503,25 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
)
|
)
|
||||||
|
|
||||||
result.assertCommonized(
|
result.assertCommonized(
|
||||||
"($longTarget1, $longTarget2, $longTarget3)", """
|
"($intTarget1, $longTarget1)", """
|
||||||
import kotlinx.cinterop.*
|
import kotlinx.cinterop.*
|
||||||
|
|
||||||
typealias X = Long
|
typealias X = PlatformInt
|
||||||
typealias XV = LongVarOf<X>
|
typealias XV = PlatformIntVarOf<X>
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
|
|
||||||
result.assertCommonized(
|
result.assertCommonized(
|
||||||
"($intTarget3, $longTarget3)", """
|
"($intTarget1, $intTarget2, $longTarget1)", """
|
||||||
|
import kotlinx.cinterop.*
|
||||||
|
|
||||||
|
typealias X = PlatformInt
|
||||||
|
typealias XV = PlatformIntVarOf<X>
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
|
||||||
|
result.assertCommonized(
|
||||||
|
"($longTarget1, $longTarget2, $intTarget1)", """
|
||||||
import kotlinx.cinterop.*
|
import kotlinx.cinterop.*
|
||||||
|
|
||||||
typealias X = PlatformInt
|
typealias X = PlatformInt
|
||||||
@@ -554,40 +537,13 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
typealias XV = PlatformIntVarOf<X>
|
typealias XV = PlatformIntVarOf<X>
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
|
|
||||||
result.assertCommonized(
|
|
||||||
"($intTarget1, $intTarget2, $intTarget3, $longTarget1)", """
|
|
||||||
import kotlinx.cinterop.*
|
|
||||||
|
|
||||||
typealias X = PlatformInt
|
|
||||||
typealias XV = PlatformIntVarOf<X>
|
|
||||||
""".trimIndent()
|
|
||||||
)
|
|
||||||
|
|
||||||
result.assertCommonized(
|
|
||||||
"($longTarget1, $longTarget2, $longTarget3, $intTarget1)", """
|
|
||||||
import kotlinx.cinterop.*
|
|
||||||
|
|
||||||
typealias X = PlatformInt
|
|
||||||
typealias XV = PlatformIntVarOf<X>
|
|
||||||
""".trimIndent()
|
|
||||||
)
|
|
||||||
|
|
||||||
result.assertCommonized(
|
|
||||||
"($intTarget1, $intTarget2, $intTarget3, $longTarget1, $longTarget2, $longTarget3)", """
|
|
||||||
import kotlinx.cinterop.*
|
|
||||||
|
|
||||||
typealias X = PlatformInt
|
|
||||||
typealias XV = PlatformIntVarOf<X>
|
|
||||||
""".trimIndent()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun `test platform types from known leaf targets are commonized`() {
|
fun `test platform types from known leaf targets are commonized`() {
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
outputTarget("(${LINUX_X64.name}, ${IOS_ARM32.name})")
|
outputTarget("(${LINUX_X64.name}, ${WATCHOS_ARM64.name})")
|
||||||
setting(PlatformIntegerCommonizationEnabledKey, true)
|
setting(PlatformIntegerCommonizationEnabledKey, true)
|
||||||
registerFakeStdlibIntegersDependency("(${LINUX_X64.name}, ${IOS_ARM32.name})")
|
registerFakeStdlibIntegersDependency("(${LINUX_X64.name}, ${WATCHOS_ARM64.name})")
|
||||||
|
|
||||||
LINUX_X64.name withSource """
|
LINUX_X64.name withSource """
|
||||||
val platformPropertyInOneLeafTarget: PlatformInt
|
val platformPropertyInOneLeafTarget: PlatformInt
|
||||||
@@ -596,7 +552,7 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
get() = null!!
|
get() = null!!
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
IOS_ARM32.name withSource """
|
WATCHOS_ARM64.name withSource """
|
||||||
val platformPropertyInOneLeafTarget: Int
|
val platformPropertyInOneLeafTarget: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
val platformPropertyInBothLeafTargets: PlatformInt
|
val platformPropertyInBothLeafTargets: PlatformInt
|
||||||
@@ -605,7 +561,7 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
result.assertCommonized(
|
result.assertCommonized(
|
||||||
"(${LINUX_X64.name}, ${IOS_ARM32.name})", """
|
"(${LINUX_X64.name}, ${WATCHOS_ARM64.name})", """
|
||||||
expect val platformPropertyInOneLeafTarget: PlatformInt
|
expect val platformPropertyInOneLeafTarget: PlatformInt
|
||||||
expect val platformPropertyInBothLeafTargets: PlatformInt
|
expect val platformPropertyInBothLeafTargets: PlatformInt
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
@@ -614,9 +570,9 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
|
|
||||||
fun `test platform types from unknown targets are not commonized`() {
|
fun `test platform types from unknown targets are not commonized`() {
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
outputTarget("(unknown, ${IOS_ARM32.name})")
|
outputTarget("(unknown, ${WATCHOS_ARM64.name})")
|
||||||
setting(PlatformIntegerCommonizationEnabledKey, true)
|
setting(PlatformIntegerCommonizationEnabledKey, true)
|
||||||
registerFakeStdlibIntegersDependency("(unknown, ${IOS_ARM32.name})")
|
registerFakeStdlibIntegersDependency("(unknown, ${WATCHOS_ARM64.name})")
|
||||||
|
|
||||||
"unknown" withSource """
|
"unknown" withSource """
|
||||||
val platformPropertyInOneLeafTarget: PlatformInt
|
val platformPropertyInOneLeafTarget: PlatformInt
|
||||||
@@ -625,7 +581,7 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
get() = null!!
|
get() = null!!
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
IOS_ARM32.name withSource """
|
WATCHOS_ARM64.name withSource """
|
||||||
val platformPropertyInOneLeafTarget: Int
|
val platformPropertyInOneLeafTarget: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
val platformPropertyInOtherLeafTarget: PlatformInt
|
val platformPropertyInOtherLeafTarget: PlatformInt
|
||||||
@@ -634,18 +590,18 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
result.assertCommonized(
|
result.assertCommonized(
|
||||||
"(unknown, ${IOS_ARM32.name})", "".trimIndent()
|
"(unknown, ${WATCHOS_ARM64.name})", "".trimIndent()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Issue: KT-51528
|
// Issue: KT-51528
|
||||||
fun `test multiple argument function with over the edge type alias available`() {
|
fun `test multiple argument function with over the edge type alias available`() {
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
outputTarget("(${IOS_ARM32.name}, ${IOS_ARM64.name})")
|
outputTarget("(${WATCHOS_ARM64.name}, ${IOS_ARM64.name})")
|
||||||
setting(PlatformIntegerCommonizationEnabledKey, true)
|
setting(PlatformIntegerCommonizationEnabledKey, true)
|
||||||
registerFakeStdlibIntegersDependency("(${IOS_ARM32.name}, ${IOS_ARM64.name})")
|
registerFakeStdlibIntegersDependency("(${WATCHOS_ARM64.name}, ${IOS_ARM64.name})")
|
||||||
|
|
||||||
IOS_ARM32.name withSource """
|
WATCHOS_ARM64.name withSource """
|
||||||
typealias Arm32Alias = UInt
|
typealias Arm32Alias = UInt
|
||||||
typealias OtherAlias = UInt
|
typealias OtherAlias = UInt
|
||||||
|
|
||||||
@@ -671,7 +627,7 @@ class HierarchicalPlatformIntegerCommonizationTest : AbstractInlineSourcesCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
result.assertCommonized(
|
result.assertCommonized(
|
||||||
"(${IOS_ARM32.name}, ${IOS_ARM64.name})", """
|
"(${WATCHOS_ARM64.name}, ${IOS_ARM64.name})", """
|
||||||
typealias OtherAlias = PlatformUInt
|
typealias OtherAlias = PlatformUInt
|
||||||
|
|
||||||
expect class Box<T>()
|
expect class Box<T>()
|
||||||
|
|||||||
Reference in New Issue
Block a user