Skip to content

Commit 5d65e6b

Browse files
committed
Kotlin Facet: Facet migration workaround for the case pre-1.1-beta -> 1.1.rc+ (reset useProjectSettings to false for old configurations)
1 parent 2e01f62 commit 5d65e6b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetConfiguration.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ class KotlinFacetConfiguration : FacetConfiguration {
4646
else {
4747
settings = KotlinFacetSettings()
4848
}
49+
50+
// Migration problem workaround for pre-1.1-beta releases (mainly 1.0.6) -> 1.1-rc+
51+
// Problematic cases: 1.1-beta/1.1-beta2 -> 1.1-rc+ (useProjectSettings gets reset to false)
52+
// This heuristic detects old enough configurations:
53+
if (element.children.none { it.getAttribute("name").value == "useProjectSettings" }
54+
&& settings.compilerInfo.k2jvmCompilerArguments == null) {
55+
settings.useProjectSettings = false
56+
}
4957
}
5058

5159
@Suppress("OverridingDeprecatedMember")

0 commit comments

Comments
 (0)