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