diff --git a/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt b/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt index 348190d62cb..eb2b094b2d8 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt @@ -33,7 +33,10 @@ private fun readV1Config(element: Element): KotlinFacetSettings { return KotlinFacetSettings().apply { val useProjectSettings = element.getOptionValue("useProjectSettings")?.toBoolean() - val targetPlatformName = element.getOptionBody("versionInfo")?.getOptionValue("targetPlatformName") + val versionInfoElement = element.getOptionBody("versionInfo") + val targetPlatformName = versionInfoElement?.getOptionValue("targetPlatformName") + val languageLevel = versionInfoElement?.getOptionValue("languageLevel") + val apiLevel = versionInfoElement?.getOptionValue("apiLevel") val targetPlatform = TargetPlatformKind.ALL_PLATFORMS.firstOrNull { it.description == targetPlatformName } ?: TargetPlatformKind.Jvm[JvmTarget.DEFAULT] @@ -57,6 +60,14 @@ private fun readV1Config(element: Element): KotlinFacetSettings { is K2JSCompilerArguments -> jsArgumentsElement?.let { XmlSerializer.deserializeInto(compilerArguments, it) } } + if (languageLevel != null) { + compilerArguments.languageVersion = languageLevel + } + + if (apiLevel != null) { + compilerArguments.apiVersion = apiLevel + } + if (useProjectSettings != null) { this.useProjectSettings = useProjectSettings }