diff --git a/core/descriptors/src/org/jetbrains/kotlin/platform/platformUtil.kt b/core/descriptors/src/org/jetbrains/kotlin/platform/platformUtil.kt index a95c6511e91..8b12eb86ecf 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/platform/platformUtil.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/platform/platformUtil.kt @@ -25,10 +25,12 @@ fun TargetPlatform?.has(klass: Class): Boolean = this != null && subplatf * also provides better description for multiplatforms. */ val TargetPlatform.oldFashionedDescription: String - get() = if (this.isCommon()) "Common (experimental) " else this.single().oldFashionedDescription + // the invocation if isCommon is not preferable as it could be governed by separate flag and may + // to appear independently on count of target platforms + get() = this.singleOrNull()?.oldFashionedDescription ?: "Common (experimental) " -/** + /** * Renders multiplatform in form * '$PLATFORM_1 / $PLATFORM_2 / ...' * e.g. diff --git a/idea/idea-jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt b/idea/idea-jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt index 91dca316390..92c7d934f64 100644 --- a/idea/idea-jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt +++ b/idea/idea-jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt @@ -296,6 +296,7 @@ private fun KotlinFacetSettings.writeLatestConfig(element: Element) { val filter = SkipDefaultsSerializationFilter() targetPlatform?.let { + element.setAttribute("platform", it.oldFashionedDescription) element.setAttribute("allPlatforms", it.componentPlatforms.map { it.serializeToString() }.joinToString(separator = "/")) } if (!useProjectSettings) { diff --git a/idea/testData/configuration/loadAndSaveProjectWithV2FacetConfig/module.iml b/idea/testData/configuration/loadAndSaveProjectWithV2FacetConfig/module.iml index 51d88d66e97..593634d6d64 100644 --- a/idea/testData/configuration/loadAndSaveProjectWithV2FacetConfig/module.iml +++ b/idea/testData/configuration/loadAndSaveProjectWithV2FacetConfig/module.iml @@ -2,7 +2,7 @@ - + diff --git a/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInTempDirTest.kt b/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInTempDirTest.kt index a81802e9695..b92c0c19e3b 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInTempDirTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInTempDirTest.kt @@ -103,7 +103,7 @@ open class ConfigureKotlinInTempDirTest : AbstractConfigureKotlinInTempDirTest() application.isSaveAllowed = true application.saveAll() val moduleFileContentAfter = String(module.moduleFile!!.contentsToByteArray()) - Assert.assertEquals(moduleFileContentBefore.replace("platform=\"JVM 1.8\"", "allPlatforms=\"JVM [1.8]\""), moduleFileContentAfter) + Assert.assertEquals(moduleFileContentBefore.replace("platform=\"JVM 1.8\"", "platform=\"JVM 1.8\" allPlatforms=\"JVM [1.8]\""), moduleFileContentAfter) } fun testApiVersionWithoutLanguageVersion() {