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 {
|
) : DescriptionAware {
|
||||||
override val description = "$name ${version.description}"
|
override val description = "$name ${version.description}"
|
||||||
|
|
||||||
class Jvm(version: JvmTarget) : TargetPlatformKind<JvmTarget>(version, "JVM") {
|
sealed class Jvm(version: JvmTarget) : TargetPlatformKind<JvmTarget>(version, "JVM") {
|
||||||
companion object {
|
object JVM_1_6 : Jvm(JvmTarget.JVM_1_6)
|
||||||
val JVM_PLATFORMS by lazy { JvmTarget.values().map(::Jvm) }
|
|
||||||
|
|
||||||
operator fun get(version: JvmTarget) = JVM_PLATFORMS[version.ordinal]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object JavaScript : TargetPlatformKind<NoVersion>(NoVersion, "JavaScript")
|
object JavaScript : TargetPlatformKind<NoVersion>(NoVersion, "JavaScript")
|
||||||
@@ -44,7 +40,7 @@ sealed class TargetPlatformKind<out Version : DescriptionAware>(
|
|||||||
object Default : TargetPlatformKind<NoVersion>(NoVersion, "Default (experimental)")
|
object Default : TargetPlatformKind<NoVersion>(NoVersion, "Default (experimental)")
|
||||||
|
|
||||||
companion object {
|
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")
|
@SuppressWarnings("unchecked")
|
||||||
private void fillJvmVersionList() {
|
private void fillJvmVersionList() {
|
||||||
for (TargetPlatformKind.Jvm jvm : TargetPlatformKind.Jvm.Companion.getJVM_PLATFORMS()) {
|
jvmVersionComboBox.addItem(TargetPlatformKind.Jvm.JVM_1_6.INSTANCE.getVersion().getDescription());
|
||||||
jvmVersionComboBox.addItem(jvm.getVersion().getDescription());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|||||||
@@ -69,13 +69,7 @@ private fun getDefaultTargetPlatform(module: Module, rootModel: ModuleRootModel?
|
|||||||
if (getRuntimeLibraryVersions(module, rootModel, TargetPlatformKind.JavaScript).isNotEmpty()) {
|
if (getRuntimeLibraryVersions(module, rootModel, TargetPlatformKind.JavaScript).isNotEmpty()) {
|
||||||
return TargetPlatformKind.JavaScript
|
return TargetPlatformKind.JavaScript
|
||||||
}
|
}
|
||||||
|
return TargetPlatformKind.Jvm.JVM_1_6
|
||||||
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]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDefaultLanguageLevel(
|
private fun getDefaultLanguageLevel(
|
||||||
@@ -98,7 +92,7 @@ internal fun getLibraryLanguageLevel(
|
|||||||
rootModel: ModuleRootModel?,
|
rootModel: ModuleRootModel?,
|
||||||
targetPlatform: TargetPlatformKind<*>?
|
targetPlatform: TargetPlatformKind<*>?
|
||||||
): LanguageVersion {
|
): 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)
|
.minWith(VersionComparatorUtil.COMPARATOR)
|
||||||
return getDefaultLanguageLevel(module, minVersion)
|
return getDefaultLanguageLevel(module, minVersion)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user