Kotlin Facet: Ignore invalid platform-specific compiler arguments

This commit is contained in:
Alexey Sedunov
2017-02-01 12:36:57 +03:00
parent 1e2b50332d
commit dbfe3370aa
@@ -205,14 +205,14 @@ fun parseCompilerArgumentsToFacet(arguments: List<String>, kotlinFacet: KotlinFa
when (versionInfo.targetPlatformKind) {
is TargetPlatformKind.Jvm -> {
val jvmTarget = K2JVMCompilerArguments().apply { parseArguments(argumentArray, this) }.jvmTarget
val jvmTarget = K2JVMCompilerArguments().apply { parseArguments(argumentArray, this, ignoreInvalidArguments = true) }.jvmTarget
if (jvmTarget != null) {
versionInfo.targetPlatformKind = TargetPlatformKind.Jvm.JVM_PLATFORMS.firstOrNull {
VersionComparatorUtil.compare(it.version.description, jvmTarget) >= 0
} ?: TargetPlatformKind.Jvm.JVM_PLATFORMS.last()
}
}
is TargetPlatformKind.JavaScript -> parseArguments(argumentArray, compilerInfo.k2jsCompilerArguments!!)
is TargetPlatformKind.JavaScript -> parseArguments(argumentArray, compilerInfo.k2jsCompilerArguments!!, ignoreInvalidArguments = true)
else -> {}
}