Prohibit JVM target 1.6

But still compile stdlib, reflect, kotlin.test and scripting runtimes
with JVM target 1.6 to simplify migration from Kotlin 1.6 to 1.7.

 #KT-45165 Fixed
This commit is contained in:
Alexander Udalov
2022-04-06 21:27:58 +02:00
parent 1e800b8e18
commit 2e515f3945
40 changed files with 63 additions and 16 deletions
@@ -7,6 +7,7 @@ JvmToolchain.updateJvmTarget(project, "1.6")
dependencies {
api kotlinStdlib("common")
testApi project(":kotlin-test:kotlin-test-common")
kotlinCompilerClasspath project(':libraries:tools:stdlib-compiler-classpath')
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile) {
@@ -18,4 +19,4 @@ jar {
}
configureSourcesJar()
configureJavadocJar()
configureJavadocJar()
@@ -7,6 +7,7 @@ JvmToolchain.updateJvmTarget(project, "1.6")
dependencies {
api kotlinStdlib("common")
testApi project(":kotlin-test:kotlin-test-annotations-common")
kotlinCompilerClasspath project(':libraries:tools:stdlib-compiler-classpath')
}
jar {
+1
View File
@@ -16,6 +16,7 @@ dependencies {
expectedBy project(':kotlin-test:kotlin-test-annotations-common')
api project(':kotlin-test:kotlin-test-jvm')
api('junit:junit:4.13.2')
kotlinCompilerClasspath(project(':libraries:tools:stdlib-compiler-classpath'))
}
+1
View File
@@ -19,6 +19,7 @@ dependencies {
api(kotlinStdlib())
testApi(project(":kotlin-test:kotlin-test-junit"))
testApi('junit:junit:4.13.2')
kotlinCompilerClasspath(project(':libraries:tools:stdlib-compiler-classpath'))
}
jar {
@@ -20,6 +20,7 @@ dependencies {
if (includeJava9) {
java9CompileOnly('org.testng:testng:7.0.0')
}
kotlinCompilerClasspath project(':libraries:tools:stdlib-compiler-classpath')
}
jar {
+1
View File
@@ -29,6 +29,7 @@ dependencies {
compileOnly project(':core:descriptors.runtime')
compileOnly project(':core:util.runtime')
compileOnly "org.jetbrains:annotations:13.0"
kotlinCompilerClasspath project(':libraries:tools:stdlib-compiler-classpath')
}
if (includeJava9) {
@@ -9,6 +9,7 @@ dependencies {
api(kotlinStdlib())
compileOnly(project(":kotlin-reflect-api"))
testApi(commonDependency("junit"))
kotlinCompilerClasspath(project(":libraries:tools:stdlib-compiler-classpath"))
}
sourceSets {
@@ -34,6 +34,7 @@ dependencies {
testRuntimeOnly("org.slf4j:slf4j-nop:1.7.30")
testImplementation(kotlin("reflect"))
testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core"))
kotlinCompilerClasspath(project(":libraries:tools:stdlib-compiler-classpath"))
}
sourceSets {
@@ -10,6 +10,7 @@ dependencies {
api(project(":kotlin-scripting-common"))
testApi(commonDependency("junit"))
testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core"))
kotlinCompilerClasspath(project(":libraries:tools:stdlib-compiler-classpath"))
}
sourceSets {
+1
View File
@@ -10,6 +10,7 @@ dependencies {
api(kotlinStdlib())
api(project(":kotlin-scripting-common"))
testApi(commonDependency("junit"))
kotlinCompilerClasspath(project(":libraries:tools:stdlib-compiler-classpath"))
}
sourceSets {
+1
View File
@@ -44,6 +44,7 @@ configurations {
dependencies {
api project(':kotlin-stdlib')
testApi project(':kotlin-test:kotlin-test-junit')
kotlinCompilerClasspath project(':libraries:tools:stdlib-compiler-classpath')
}
jar {
@@ -20,6 +20,7 @@ val builtins by configurations.creating {
dependencies {
compileOnly(project(":kotlin-stdlib"))
builtins(project(":core:builtins"))
kotlinCompilerClasspath(project(":libraries:tools:stdlib-compiler-classpath"))
}
sourceSets {
+2
View File
@@ -63,6 +63,8 @@ dependencies {
testApi project(':kotlin-test:kotlin-test-junit')
builtins project(':core:builtins')
kotlinCompilerClasspath project(':libraries:tools:stdlib-compiler-classpath')
}
jar {
@@ -16,6 +16,7 @@ sourceSets {
dependencies {
compileOnly DependenciesKt.kotlinBuiltins(project)
kotlinCompilerClasspath project(':libraries:tools:stdlib-compiler-classpath')
}
configureSourcesJar()
@@ -24,4 +24,4 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToo
* Default value: false
*/
var useFir: kotlin.Boolean
}
}
@@ -12,8 +12,8 @@ interface KotlinJvmOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOption
var javaParameters: kotlin.Boolean
/**
* Target version of the generated JVM bytecode (1.6 (DEPRECATED), 1.8, 9, 10, ..., 18), default is 1.8
* Possible values: "1.6", "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"
* Target version of the generated JVM bytecode (1.8, 9, 10, ..., 18), default is 1.8
* Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"
* Default value: null
*/
var jvmTarget: kotlin.String?
@@ -8,6 +8,7 @@ configurePublishing(project)
dependencies {
compileOnly kotlinStdlib()
kotlinCompilerClasspath project(':libraries:tools:stdlib-compiler-classpath')
}
sourceSets {
@@ -0,0 +1,9 @@
plugins {
java
id("jps-compatible")
}
sourceSets {
"main" { projectDefault() }
"test" {}
}