Support -Xjdk-release=8 as alias for -Xjdk-release=1.8

#KT-53278 Fixed
This commit is contained in:
Alexander Udalov
2022-08-29 13:59:39 +02:00
parent 19bbcc5869
commit 13ca189825
4 changed files with 16 additions and 1 deletions
@@ -51,7 +51,12 @@ fun CompilerConfiguration.setupJvmSpecificArguments(arguments: K2JVMCompilerArgu
}
}
val jvmTargetValue = releaseTargetArg ?: jvmTargetArg
val jvmTargetValue = when (releaseTargetArg) {
"6" -> "1.6"
"8" -> "1.8"
null -> jvmTargetArg
else -> releaseTargetArg
}
if (jvmTargetValue != null) {
val jvmTarget = JvmTarget.fromString(jvmTargetValue)
if (jvmTarget != null) {
+4
View File
@@ -0,0 +1,4 @@
-Xjdk-release=8
$TESTDATA_DIR$/jdkRelease.kt
-d
$TEMP_DIR$
+1
View File
@@ -0,0 +1 @@
OK
@@ -607,6 +607,11 @@ public class CliTestGenerated extends AbstractCliTest {
runTest("compiler/testData/cli/jvm/jdkRelease.args");
}
@TestMetadata("jdkRelease8.args")
public void testJdkRelease8() throws Exception {
runTest("compiler/testData/cli/jvm/jdkRelease8.args");
}
@TestMetadata("jspecifyByLv15.args")
public void testJspecifyByLv15() throws Exception {
runTest("compiler/testData/cli/jvm/jspecifyByLv15.args");