HMPP: fix importing target platforms for case when JVM targets are involved
This commit is contained in:
@@ -192,15 +192,15 @@ class KotlinFacetSettings {
|
|||||||
|
|
||||||
var targetPlatform: TargetPlatform? = null
|
var targetPlatform: TargetPlatform? = null
|
||||||
get() {
|
get() {
|
||||||
// This work-around is required in order to fix importing of the proper JVM target version.
|
// This work-around is required in order to fix importing of the proper JVM target version and works only
|
||||||
|
// for fully actualized JVM target platform
|
||||||
//TODO(auskov): this hack should be removed after fixing equals in SimplePlatform
|
//TODO(auskov): this hack should be removed after fixing equals in SimplePlatform
|
||||||
val args = compilerArguments
|
val args = compilerArguments
|
||||||
val mappedPlatforms = field?.componentPlatforms?.flatMap {
|
val singleSimplePlatform = field?.componentPlatforms?.singleOrNull()
|
||||||
if (JvmPlatforms.defaultJvmPlatform.first() == it && args != null) (IdePlatformKind.platformByCompilerArguments(args)
|
if (singleSimplePlatform == JvmPlatforms.defaultJvmPlatform.singleOrNull() && args != null) {
|
||||||
?: return null) else listOf(it)
|
return IdePlatformKind.platformByCompilerArguments(args)
|
||||||
}?.toSet() ?: return null
|
}
|
||||||
|
return field
|
||||||
return TargetPlatform(mappedPlatforms)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user