From 48cd86b7171355b819ef53451f8b884210518208 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 6 Oct 2020 18:16:56 +0200 Subject: [PATCH] Add JVM target bytecode version 15 #KT-41916 Fixed --- .../kotlin/cli/common/arguments/K2JVMCompilerArguments.kt | 2 +- .../config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt | 2 ++ compiler/testData/cli/jvm/help.out | 2 +- compiler/testData/cli/jvm/wrongJvmTargetVersion.out | 2 +- .../org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index 2e8a38ba78a..c1e0e6c7043 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -71,7 +71,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { @Argument( value = "-jvm-target", valueDescription = "", - description = "Target version of the generated JVM bytecode (1.6, 1.8, 9, 10, 11, 12, 13 or 14), default is 1.6" + description = "Target version of the generated JVM bytecode (1.6, 1.8, 9, 10, 11, 12, 13, 14 or 15), default is 1.6" ) var jvmTarget: String? by NullableStringFreezableVar(JvmTarget.DEFAULT.description) diff --git a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt index 3974e7dac9b..ea140a8d9af 100644 --- a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt +++ b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt @@ -28,6 +28,7 @@ enum class JvmTarget(override val description: String) : TargetPlatformVersion { JVM_12("12"), JVM_13("13"), JVM_14("14"), + JVM_15("15"), ; val bytecodeVersion: Int by lazy { @@ -40,6 +41,7 @@ enum class JvmTarget(override val description: String) : TargetPlatformVersion { JVM_12 -> Opcodes.V12 JVM_13 -> Opcodes.V12 + 1 JVM_14 -> Opcodes.V12 + 2 + JVM_15 -> Opcodes.V12 + 3 } } diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index d70cd56fb46..cad39163ca3 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -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 Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME - -jvm-target Target version of the generated JVM bytecode (1.6, 1.8, 9, 10, 11, 12, 13 or 14), default is 1.6 + -jvm-target Target version of the generated JVM bytecode (1.6, 1.8, 9, 10, 11, 12, 13, 14 or 15), default is 1.6 -module-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 diff --git a/compiler/testData/cli/jvm/wrongJvmTargetVersion.out b/compiler/testData/cli/jvm/wrongJvmTargetVersion.out index 8fe5308de15..7afaea0c1de 100644 --- a/compiler/testData/cli/jvm/wrongJvmTargetVersion.out +++ b/compiler/testData/cli/jvm/wrongJvmTargetVersion.out @@ -1,3 +1,3 @@ error: unknown JVM target version: 1.5 -Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14 +Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15 COMPILATION_ERROR diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt index 165b3fc7be4..c19b1025183 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt @@ -23,8 +23,8 @@ interface KotlinJvmOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOption var jdkHome: kotlin.String? /** - * Target version of the generated JVM bytecode (1.6, 1.8, 9, 10, 11, 12, 13 or 14), default is 1.6 - * Possible values: "1.6", "1.8", "9", "10", "11", "12", "13", "14" + * Target version of the generated JVM bytecode (1.6, 1.8, 9, 10, 11, 12, 13, 14 or 15), default is 1.6 + * Possible values: "1.6", "1.8", "9", "10", "11", "12", "13", "14", "15" * Default value: "1.6" */ var jvmTarget: kotlin.String