Temporary remove JVM_1_8 target from facet settings
This commit is contained in:
@@ -31,12 +31,8 @@ sealed class TargetPlatformKind<out Version : DescriptionAware>(
|
||||
) : DescriptionAware {
|
||||
override val description = "$name ${version.description}"
|
||||
|
||||
class Jvm(version: JvmTarget) : TargetPlatformKind<JvmTarget>(version, "JVM") {
|
||||
companion object {
|
||||
val JVM_PLATFORMS by lazy { JvmTarget.values().map(::Jvm) }
|
||||
|
||||
operator fun get(version: JvmTarget) = JVM_PLATFORMS[version.ordinal]
|
||||
}
|
||||
sealed class Jvm(version: JvmTarget) : TargetPlatformKind<JvmTarget>(version, "JVM") {
|
||||
object JVM_1_6 : Jvm(JvmTarget.JVM_1_6)
|
||||
}
|
||||
|
||||
object JavaScript : TargetPlatformKind<NoVersion>(NoVersion, "JavaScript")
|
||||
@@ -44,7 +40,7 @@ sealed class TargetPlatformKind<out Version : DescriptionAware>(
|
||||
object Default : TargetPlatformKind<NoVersion>(NoVersion, "Default (experimental)")
|
||||
|
||||
companion object {
|
||||
val ALL_PLATFORMS: List<TargetPlatformKind<*>> by lazy { Jvm.JVM_PLATFORMS + JavaScript + Default }
|
||||
val ALL_PLATFORMS: List<TargetPlatformKind<*>> by lazy { listOf(Jvm.JVM_1_6, JavaScript, Default) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -140,9 +140,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void fillJvmVersionList() {
|
||||
for (TargetPlatformKind.Jvm jvm : TargetPlatformKind.Jvm.Companion.getJVM_PLATFORMS()) {
|
||||
jvmVersionComboBox.addItem(jvm.getVersion().getDescription());
|
||||
}
|
||||
jvmVersionComboBox.addItem(TargetPlatformKind.Jvm.JVM_1_6.INSTANCE.getVersion().getDescription());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -69,13 +69,7 @@ private fun getDefaultTargetPlatform(module: Module, rootModel: ModuleRootModel?
|
||||
if (getRuntimeLibraryVersions(module, rootModel, TargetPlatformKind.JavaScript).isNotEmpty()) {
|
||||
return TargetPlatformKind.JavaScript
|
||||
}
|
||||
|
||||
val sdk = ((rootModel ?: ModuleRootManager.getInstance(module))).sdk
|
||||
val sdkVersion = (sdk?.sdkType as? JavaSdk)?.getVersion(sdk!!)
|
||||
return when {
|
||||
sdkVersion == null || sdkVersion >= JavaSdkVersion.JDK_1_8 -> TargetPlatformKind.Jvm[JvmTarget.JVM_1_8]
|
||||
else -> TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]
|
||||
}
|
||||
return TargetPlatformKind.Jvm.JVM_1_6
|
||||
}
|
||||
|
||||
private fun getDefaultLanguageLevel(
|
||||
@@ -98,7 +92,7 @@ internal fun getLibraryLanguageLevel(
|
||||
rootModel: ModuleRootModel?,
|
||||
targetPlatform: TargetPlatformKind<*>?
|
||||
): LanguageVersion {
|
||||
val minVersion = getRuntimeLibraryVersions(module, rootModel, targetPlatform ?: TargetPlatformKind.Jvm[JvmTarget.JVM_1_8])
|
||||
val minVersion = getRuntimeLibraryVersions(module, rootModel, targetPlatform ?: TargetPlatformKind.Jvm.JVM_1_6)
|
||||
.minWith(VersionComparatorUtil.COMPARATOR)
|
||||
return getDefaultLanguageLevel(module, minVersion)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user