Kotlin Facet: Fix facet creation with non-default JVM target
Original commit: 18632c3200
This commit is contained in:
@@ -132,14 +132,20 @@ class KotlinFacetSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun TargetPlatformKind<*>.createCompilerArguments(): CommonCompilerArguments {
|
fun TargetPlatformKind<*>.createCompilerArguments(init: CommonCompilerArguments.() -> Unit = {}): CommonCompilerArguments {
|
||||||
return when (this) {
|
val arguments = when (this) {
|
||||||
is TargetPlatformKind.Jvm -> {
|
is TargetPlatformKind.Jvm -> K2JVMCompilerArguments()
|
||||||
K2JVMCompilerArguments().apply { jvmTarget = this@createCompilerArguments.version.description }
|
|
||||||
}
|
|
||||||
is TargetPlatformKind.JavaScript -> K2JSCompilerArguments()
|
is TargetPlatformKind.JavaScript -> K2JSCompilerArguments()
|
||||||
is TargetPlatformKind.Common -> K2MetadataCompilerArguments()
|
is TargetPlatformKind.Common -> K2MetadataCompilerArguments()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
arguments.init()
|
||||||
|
|
||||||
|
if (arguments is K2JVMCompilerArguments) {
|
||||||
|
arguments.jvmTarget = this@createCompilerArguments.version.description
|
||||||
|
}
|
||||||
|
|
||||||
|
return arguments
|
||||||
}
|
}
|
||||||
|
|
||||||
interface KotlinFacetSettingsProvider {
|
interface KotlinFacetSettingsProvider {
|
||||||
|
|||||||
Reference in New Issue
Block a user