Add -Xsuppress-deprecated-jvm-target-warning to modules compiled with 1.6

Currently this leads to an unknown argument warning, but it'll be
removed automatically on the next bootstrap.
This commit is contained in:
Alexander Udalov
2021-02-02 13:50:09 +01:00
parent 99b5e5a373
commit e0b6d4d917
25 changed files with 138 additions and 21 deletions
+6 -1
View File
@@ -1,4 +1,3 @@
plugins { plugins {
kotlin("jvm") kotlin("jvm")
id("jps-compatible") id("jps-compatible")
@@ -17,3 +16,9 @@ sourceSets {
} }
testsJar {} testsJar {}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
@@ -19,3 +19,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
+6
View File
@@ -21,3 +21,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
+6
View File
@@ -25,3 +25,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
+6 -3
View File
@@ -29,8 +29,11 @@ val compileJava by tasks.getting(JavaCompile::class) {
} }
val compileKotlin by tasks.getting(KotlinCompile::class) { val compileKotlin by tasks.getting(KotlinCompile::class) {
kotlinOptions.jvmTarget = "1.6" kotlinOptions {
kotlinOptions.jdkHome = rootProject.extra["JDK_16"] as String jvmTarget = "1.6"
jdkHome = rootProject.extra["JDK_16"] as String
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
} }
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateRuntimeDescriptorTestsKt") val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateRuntimeDescriptorTestsKt")
@@ -39,4 +42,4 @@ projectTest(parallel = true) {
workingDir = rootDir workingDir = rootDir
} }
testsJar() testsJar()
+6
View File
@@ -22,3 +22,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
@@ -21,3 +21,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
@@ -20,3 +20,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
+6
View File
@@ -23,3 +23,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
+6
View File
@@ -19,3 +19,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
+6
View File
@@ -20,3 +20,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
+6 -2
View File
@@ -1,6 +1,4 @@
plugins { plugins {
java
kotlin("jvm") kotlin("jvm")
id("jps-compatible") id("jps-compatible")
} }
@@ -21,3 +19,9 @@ tasks.withType<JavaCompile> {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
+1
View File
@@ -42,6 +42,7 @@ ext.configureJvm6Project = { Project project ->
if (!tasksWithWarnings.contains(task.path)) { if (!tasksWithWarnings.contains(task.path)) {
task.kotlinOptions { task.kotlinOptions {
allWarningsAsErrors = true allWarningsAsErrors = true
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
} }
} }
} }
+8 -2
View File
@@ -30,12 +30,18 @@ configureSourcesJar()
configureJavadocJar() configureJavadocJar()
compileKotlin { compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"] kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning",
]
kotlinOptions.moduleName = project.name kotlinOptions.moduleName = project.name
} }
compileTestKotlin { compileTestKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"] kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning",
]
} }
configureJvmIrBackend(project) configureJvmIrBackend(project)
+8 -2
View File
@@ -40,12 +40,18 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
} }
compileKotlin { compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"] kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning",
]
kotlinOptions.moduleName = project.name kotlinOptions.moduleName = project.name
} }
compileTestKotlin { compileTestKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"] kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning",
]
} }
configureJvmIrBackend(project) configureJvmIrBackend(project)
+10 -3
View File
@@ -41,13 +41,20 @@ configureSourcesJar()
configureJavadocJar() configureJavadocJar()
compileKotlin { compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xnormalize-constructor-calls=enable", kotlinOptions.freeCompilerArgs = [
"-Xopt-in=kotlin.contracts.ExperimentalContracts"] "-Xallow-kotlin-package",
"-Xnormalize-constructor-calls=enable",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xsuppress-deprecated-jvm-target-warning",
]
kotlinOptions.moduleName = project.archivesBaseName kotlinOptions.moduleName = project.archivesBaseName
} }
compileTestKotlin { compileTestKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"] kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning",
]
} }
configureJvmIrBackend(project) configureJvmIrBackend(project)
+8 -2
View File
@@ -33,12 +33,18 @@ configureSourcesJar()
configureJavadocJar() configureJavadocJar()
compileKotlin { compileKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"] kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning",
]
kotlinOptions.moduleName = project.name kotlinOptions.moduleName = project.name
} }
compileTestKotlin { compileTestKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"] kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning",
]
} }
configureJvmIrBackend(project) configureJvmIrBackend(project)
+1
View File
@@ -47,6 +47,7 @@ compileKotlin {
"-Xnormalize-constructor-calls=enable", "-Xnormalize-constructor-calls=enable",
"-Xno-optimized-callable-references", "-Xno-optimized-callable-references",
"-Xno-kotlin-nothing-value-exception", "-Xno-kotlin-nothing-value-exception",
"-Xsuppress-deprecated-jvm-target-warning",
"-Xopt-in=kotlin.RequiresOptIn"] "-Xopt-in=kotlin.RequiresOptIn"]
moduleName = "kotlin-reflection" moduleName = "kotlin-reflection"
} }
+4 -2
View File
@@ -1,4 +1,3 @@
plugins { plugins {
kotlin("jvm") kotlin("jvm")
id("jps-compatible") id("jps-compatible")
@@ -21,7 +20,10 @@ sourceSets {
} }
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> { tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package" kotlinOptions.freeCompilerArgs += listOf(
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning"
)
} }
tasks.withType<Test> { tasks.withType<Test> {
+2
View File
@@ -77,6 +77,7 @@ compileKotlin {
"-Xnormalize-constructor-calls=enable", "-Xnormalize-constructor-calls=enable",
"-Xopt-in=kotlin.RequiresOptIn", "-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.contracts.ExperimentalContracts", "-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xsuppress-deprecated-jvm-target-warning",
] ]
kotlinOptions.moduleName = project.name kotlinOptions.moduleName = project.name
} }
@@ -90,6 +91,7 @@ compileTestKotlin {
"-Xopt-in=kotlin.ExperimentalStdlibApi", "-Xopt-in=kotlin.ExperimentalStdlibApi",
"-Xopt-in=kotlin.io.path.ExperimentalPathApi", "-Xopt-in=kotlin.io.path.ExperimentalPathApi",
"-Xcommon-sources=${fileTree('../test').join(',')}", "-Xcommon-sources=${fileTree('../test').join(',')}",
"-Xsuppress-deprecated-jvm-target-warning",
] ]
} }
+2 -1
View File
@@ -120,7 +120,8 @@ compileKotlin {
"-Xopt-in=kotlin.ExperimentalMultiplatform", "-Xopt-in=kotlin.ExperimentalMultiplatform",
"-Xopt-in=kotlin.contracts.ExperimentalContracts", "-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xinline-classes", "-Xinline-classes",
"-Xuse-14-inline-classes-mangling-scheme" "-Xuse-14-inline-classes-mangling-scheme",
"-Xsuppress-deprecated-jvm-target-warning",
] ]
moduleName = "kotlin-stdlib" moduleName = "kotlin-stdlib"
} }
+3 -2
View File
@@ -34,8 +34,9 @@ configureJavadocJar()
compileKotlin { compileKotlin {
kotlinOptions.freeCompilerArgs = [ kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package", "-Xallow-kotlin-package",
"-Xnormalize-constructor-calls=enable", "-Xnormalize-constructor-calls=enable",
"-Xsuppress-deprecated-jvm-target-warning",
] ]
kotlinOptions.moduleName = project.name kotlinOptions.moduleName = project.name
} }
@@ -22,3 +22,9 @@ publish()
runtimeJar() runtimeJar()
sourcesJar() sourcesJar()
javadocJar() javadocJar()
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
@@ -21,3 +21,9 @@ publish()
runtimeJar() runtimeJar()
sourcesJar() sourcesJar()
javadocJar() javadocJar()
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}
@@ -24,4 +24,10 @@ publish {
runtimeJar() runtimeJar()
sourcesJar() sourcesJar()
javadocJar() javadocJar()
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
}
}