Add JVM target bytecode version 20

#KT-57495 Fixed
This commit is contained in:
Alexander Udalov
2023-03-21 23:16:17 +01:00
committed by Space Team
parent 7aeca2fda0
commit 37c776b233
9 changed files with 12 additions and 9 deletions
@@ -36,6 +36,7 @@ enum class JvmTarget(
JVM_17("17", Opcodes.V16 + 1),
JVM_18("18", Opcodes.V16 + 2),
JVM_19("19", Opcodes.V16 + 3),
JVM_20("20", Opcodes.V16 + 4),
;
override fun toString() = description
@@ -61,7 +62,7 @@ enum class JvmTarget(
values().asList() - JVM_1_6
const val SUPPORTED_VERSIONS_DESCRIPTION =
"1.8, 9, 10, ..., 19"
"1.8, 9, 10, ..., 20"
init {
check(SUPPORTED_VERSIONS_DESCRIPTION == "1.8, 9, 10, ..., ${values().last().description}") {
+1 -1
View File
@@ -42,7 +42,7 @@ where advanced options include:
-Xjava-source-roots=<path> Paths to directories with Java source files
-Xjavac-arguments=<option[,]> Java compiler arguments
-Xjdk-release=<version> Compile against the specified JDK API version, similarly to javac's `-release`. Requires JDK 9 or newer.
Supported versions depend on the used JDK; for JDK 17+ supported versions are 1.8, 9, 10, ..., 19.
Supported versions depend on the used JDK; for JDK 17+ supported versions are 1.8, 9, 10, ..., 20.
Also sets `-jvm-target` value equal to the selected JDK version
-Xjspecify-annotations=ignore|strict|warn
Specify behavior for jspecify annotations.
+1 -1
View File
@@ -6,7 +6,7 @@ where possible options include:
-include-runtime Include Kotlin runtime into the resulting JAR
-java-parameters Generate metadata for Java 1.8 reflection on method parameters
-jdk-home <path> Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME
-jvm-target <version> Target version of the generated JVM bytecode (1.8, 9, 10, ..., 19), default is 1.8
-jvm-target <version> Target version of the generated JVM bytecode (1.8, 9, 10, ..., 20), default is 1.8
-module-name <name> Name of the generated .kotlin_module file
-no-jdk Don't automatically include the Java runtime into the classpath
-no-reflect Don't automatically include Kotlin reflection into the classpath
+1 -1
View File
@@ -1,3 +1,3 @@
error: unknown JVM target version: 1.5
Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
COMPILATION_ERROR
@@ -22,7 +22,7 @@ fun box() : String {
y
return "FAIL 4"
} catch(t: Error) {
if (t.cause != null) return "FAIL 5"
// On JVM < 20, t.cause is null, but on JVM >= 20, it's ExceptionInInitializerError.
}
return "OK"
}
@@ -18,6 +18,7 @@ enum class JvmTarget(val target: String) {
JVM_17("17"),
JVM_18("18"),
JVM_19("19"),
JVM_20("20"),
;
companion object {
@@ -91,6 +91,7 @@ public final class org/jetbrains/kotlin/gradle/dsl/JvmTarget : java/lang/Enum {
public static final field JVM_18 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget;
public static final field JVM_19 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget;
public static final field JVM_1_8 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget;
public static final field JVM_20 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget;
public static final field JVM_9 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget;
public final fun getTarget ()Ljava/lang/String;
public static fun valueOf (Ljava/lang/String;)Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget;
@@ -15,8 +15,8 @@ interface KotlinJvmCompilerOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommo
val javaParameters: org.gradle.api.provider.Property<kotlin.Boolean>
/**
* Target version of the generated JVM bytecode (1.8, 9, 10, ..., 19), default is 1.8
* Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
* Target version of the generated JVM bytecode (1.8, 9, 10, ..., 20), default is 1.8
* Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"
* Default value: null
*/
@get:org.gradle.api.tasks.Optional
@@ -21,8 +21,8 @@ interface KotlinJvmOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
private val org.jetbrains.kotlin.gradle.dsl.JvmTarget?.jvmTargetKotlinOption get() = this?.target
/**
* Target version of the generated JVM bytecode (1.8, 9, 10, ..., 19), default is 1.8
* Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
* Target version of the generated JVM bytecode (1.8, 9, 10, ..., 20), default is 1.8
* Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"
* Default value: null
*/
var jvmTarget: kotlin.String?