Skip to content

Commit 1fb90ac

Browse files
committed
Copy compiler arguments from iml even if "Use project settings" checkbox is checked. This is deadly needed for the compiler plugins no-arg and all-open, assuming that the default state of the checkbox is "on". (KT-15686, KT-15686).
This is a temporary fix, and it should be reverted when "Use project settings" will be disabled by default in modules imported from external build tools (Maven, Gradle).
1 parent 50a7164 commit 1fb90ac

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

jps-plugin/src/org/jetbrains/kotlin/jps/JpsKotlinCompilerSettings.kt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,22 @@ class JpsKotlinCompilerSettings : JpsElementBase<JpsKotlinCompilerSettings>() {
7272
fun getCommonCompilerArguments(module: JpsModule): CommonCompilerArguments {
7373
val defaultArguments = getSettings(module.project).commonCompilerArguments
7474
val facetSettings = module.kotlinFacetExtension?.settings ?: return defaultArguments
75-
if (facetSettings.useProjectSettings) return defaultArguments
7675
val (languageLevel, apiLevel) = facetSettings.versionInfo
7776
val facetArguments = facetSettings.compilerInfo.commonCompilerArguments ?: return defaultArguments
7877
return copyBean(facetArguments).apply {
79-
languageVersion = languageLevel?.description
80-
apiVersion = apiLevel?.description
81-
multiPlatform = module
82-
.dependenciesList
83-
.dependencies
84-
.any { (it as? JpsModuleDependency)?.module?.targetPlatform == TargetPlatformKind.Common }
78+
if (facetSettings.useProjectSettings) {
79+
languageVersion = defaultArguments.languageVersion
80+
apiVersion = defaultArguments.apiVersion
81+
multiPlatform = defaultArguments.multiPlatform
82+
}
83+
else {
84+
languageVersion = languageLevel?.description
85+
apiVersion = apiLevel?.description
86+
multiPlatform = module
87+
.dependenciesList
88+
.dependencies
89+
.any { (it as? JpsModuleDependency)?.module?.targetPlatform == TargetPlatformKind.Common }
90+
}
8591
}
8692
}
8793

0 commit comments

Comments
 (0)