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).
This commit is contained in:
committed by
Yan Zhulanow
parent
50a7164efe
commit
1fb90ac0fd
@@ -72,16 +72,22 @@ class JpsKotlinCompilerSettings : JpsElementBase<JpsKotlinCompilerSettings>() {
|
||||
fun getCommonCompilerArguments(module: JpsModule): CommonCompilerArguments {
|
||||
val defaultArguments = getSettings(module.project).commonCompilerArguments
|
||||
val facetSettings = module.kotlinFacetExtension?.settings ?: return defaultArguments
|
||||
if (facetSettings.useProjectSettings) return defaultArguments
|
||||
val (languageLevel, apiLevel) = facetSettings.versionInfo
|
||||
val facetArguments = facetSettings.compilerInfo.commonCompilerArguments ?: return defaultArguments
|
||||
return copyBean(facetArguments).apply {
|
||||
languageVersion = languageLevel?.description
|
||||
apiVersion = apiLevel?.description
|
||||
multiPlatform = module
|
||||
.dependenciesList
|
||||
.dependencies
|
||||
.any { (it as? JpsModuleDependency)?.module?.targetPlatform == TargetPlatformKind.Common }
|
||||
if (facetSettings.useProjectSettings) {
|
||||
languageVersion = defaultArguments.languageVersion
|
||||
apiVersion = defaultArguments.apiVersion
|
||||
multiPlatform = defaultArguments.multiPlatform
|
||||
}
|
||||
else {
|
||||
languageVersion = languageLevel?.description
|
||||
apiVersion = apiLevel?.description
|
||||
multiPlatform = module
|
||||
.dependenciesList
|
||||
.dependencies
|
||||
.any { (it as? JpsModuleDependency)?.module?.targetPlatform == TargetPlatformKind.Common }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user