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 479d86a1402..436b626f6bd 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 @@ -305,7 +305,7 @@ private fun KotlinFacetSettings.writeLatestConfig(element: Element) { targetPlatform?.let { element.setAttribute("platform", it.oldFashionedDescription) - element.setAttribute("allPlatforms", it.componentPlatforms.map { it.serializeToString() }.joinToString(separator = "/")) + element.setAttribute("allPlatforms", it.componentPlatforms.map { it.serializeToString() }.sorted().joinToString(separator = "/")) } if (!useProjectSettings) { element.setAttribute("useProjectSettings", useProjectSettings.toString()) diff --git a/idea/testData/configuration/loadAndSaveProjectHMPPFacetConfig/module.iml b/idea/testData/configuration/loadAndSaveProjectHMPPFacetConfig/module.iml new file mode 100644 index 00000000000..5183ddd1136 --- /dev/null +++ b/idea/testData/configuration/loadAndSaveProjectHMPPFacetConfig/module.iml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/configuration/loadAndSaveProjectHMPPFacetConfig/projectFile.ipr b/idea/testData/configuration/loadAndSaveProjectHMPPFacetConfig/projectFile.ipr new file mode 100644 index 00000000000..a1407e2c8cd --- /dev/null +++ b/idea/testData/configuration/loadAndSaveProjectHMPPFacetConfig/projectFile.ipr @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idea/testData/configuration/loadAndSaveProjectHMPPFacetConfig/src/foo.kt b/idea/testData/configuration/loadAndSaveProjectHMPPFacetConfig/src/foo.kt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInTempDirTest.kt b/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInTempDirTest.kt index d9161fe8b63..3787297ae14 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInTempDirTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInTempDirTest.kt @@ -116,6 +116,16 @@ open class ConfigureKotlinInTempDirTest : AbstractConfigureKotlinInTempDirTest() Assert.assertEquals(moduleFileContentBefore.replace("platform=\"JVM 1.8\"", "platform=\"JVM 1.8\" allPlatforms=\"JVM [1.8]\""), moduleFileContentAfter) } + fun testLoadAndSaveProjectHMPPFacetConfig() { + val moduleFileContentBefore = String(module.moduleFile!!.contentsToByteArray()) + val application = ApplicationManager.getApplication() as ApplicationImpl + application.isSaveAllowed = true + application.saveAll() + val moduleFileContentAfter = String(module.moduleFile!!.contentsToByteArray()) + Assert.assertEquals(moduleFileContentBefore.replace("platform=\"JVM 1.8\"", "platform=\"JVM 1.8\" allPlatforms=\"JVM [1.8]\""), moduleFileContentAfter) + } + + fun testApiVersionWithoutLanguageVersion() { KotlinCommonCompilerArgumentsHolder.getInstance(myProject) val settings = myProject.getLanguageVersionSettings()