From 438c370fec2ccc4bd8f7f619023287f3936265db Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Tue, 4 Sep 2018 15:35:48 +0300 Subject: [PATCH] MPP: Fix compatibility issue with Android Studio 3.3 Canary 7 'TargetPlatformKind' is still used in AS 3.3 so we can't remove it entirely yet. Original commit: f55a52b86ed0aa367f5fd03bc0aafbdd873c8590 --- .../kotlin/config/KotlinFacetSettings.kt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/jps/jps-common/src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt b/jps/jps-common/src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt index c3428d7b61c..8b1cf56172b 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/config/KotlinFacetSettings.kt @@ -26,6 +26,31 @@ import org.jetbrains.kotlin.platform.impl.JsIdePlatformKind import org.jetbrains.kotlin.platform.impl.JvmIdePlatformKind import org.jetbrains.kotlin.utils.DescriptionAware +@Deprecated("Use IdePlatformKind instead.", level = DeprecationLevel.ERROR) +sealed class TargetPlatformKind( + val version: Version, + val name: String +) : DescriptionAware { + override val description = "$name ${version.description}" + + class Jvm(version: JvmTarget) : @Suppress("DEPRECATION_ERROR") TargetPlatformKind(version, "JVM") { + companion object { + private val JVM_PLATFORMS by lazy { JvmTarget.values().map(::Jvm) } + operator fun get(version: JvmTarget) = JVM_PLATFORMS[version.ordinal] + } + } + + object JavaScript : @Suppress("DEPRECATION_ERROR") TargetPlatformKind( + TargetPlatformVersion.NoVersion, + "JavaScript" + ) + + object Common : @Suppress("DEPRECATION_ERROR") TargetPlatformKind( + TargetPlatformVersion.NoVersion, + "Common (experimental)" + ) +} + object CoroutineSupport { @JvmStatic fun byCompilerArguments(arguments: CommonCompilerArguments?): LanguageFeature.State =