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 f1d770d423c..40b90f2071a 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/config/facetSerialization.kt @@ -195,19 +195,7 @@ private fun readElementsList(element: Element, rootElementName: String, elementN } private fun readV2Config(element: Element): KotlinFacetSettings { - return readV2AndLaterConfig(element).apply { - element.getChild("compilerArguments")?.children?.let { args -> - when { - args.any { arg -> arg.attributes[0].value == "coroutinesEnable" && arg.attributes[1].booleanValue } -> - compilerArguments!!.coroutinesState = CommonCompilerArguments.ENABLE - args.any { arg -> arg.attributes[0].value == "coroutinesWarn" && arg.attributes[1].booleanValue } -> - compilerArguments!!.coroutinesState = CommonCompilerArguments.WARN - args.any { arg -> arg.attributes[0].value == "coroutinesError" && arg.attributes[1].booleanValue } -> - compilerArguments!!.coroutinesState = CommonCompilerArguments.ERROR - else -> compilerArguments!!.coroutinesState = CommonCompilerArguments.DEFAULT - } - } - } + return readV2AndLaterConfig(element) } private fun readLatestConfig(element: Element): KotlinFacetSettings { @@ -408,35 +396,10 @@ fun Element.dropVersionsIfNecessary(settings: CommonCompilerArguments) { } } -// Special treatment of v2 may be dropped after transition to IDEA 172 -private fun KotlinFacetSettings.writeV2Config(element: Element) { - writeLatestConfig(element) - element.getChild("compilerArguments")?.let { - it.getOption("coroutinesState")?.detach() - val coroutineOption = when (compilerArguments?.coroutinesState) { - CommonCompilerArguments.ENABLE -> "coroutinesEnable" - CommonCompilerArguments.WARN -> "coroutinesWarn" - CommonCompilerArguments.ERROR -> "coroutinesError" - else -> null - } - if (coroutineOption != null) { - Element("option").apply { - setAttribute("name", coroutineOption) - setAttribute("value", "true") - it.addContent(this) - } - } - } -} - fun KotlinFacetSettings.serializeFacetSettings(element: Element) { val versionToWrite = if (version == 2) version else KotlinFacetSettings.CURRENT_VERSION element.setAttribute("version", versionToWrite.toString()) - if (versionToWrite == 2) { - writeV2Config(element) - } else { - writeLatestConfig(element) - } + writeLatestConfig(element) } private fun TargetPlatform.serializeComponentPlatforms(): String {