Remove :libraries:tools:stdlib-compiler-classpath project

It was used as a workaround to allow jvmTarget=1.6 in stdlib.
This commit is contained in:
Abduqodiri Qurbonzoda
2022-08-10 17:59:52 +03:00
parent de10a5b8fe
commit 983c7adb1e
7 changed files with 2 additions and 30 deletions
@@ -28,8 +28,6 @@ dependencies {
}
}
project.applyFixForStdlib16()
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
project.configureJvmDefaultToolchain()
project.addEmbeddedConfigurations()
@@ -201,17 +199,6 @@ fun Project.configureKotlinCompilationOptions() {
}
}
// Should the workaround be removed ?
// Still compile stdlib, reflect, kotlin.test and scripting runtimes
// with JVM target 1.6 to simplify migration from Kotlin 1.6 to 1.7.
fun Project.applyFixForStdlib16() {
plugins.withType<KotlinBasePluginWrapper>() {
dependencies {
"kotlinCompilerClasspath"(project(":libraries:tools:stdlib-compiler-classpath"))
}
}
}
fun Project.configureArtifacts() {
tasks.withType<Javadoc>().configureEach {
enabled = false
@@ -56,7 +56,7 @@ fun CompilerConfiguration.setupJvmSpecificArguments(arguments: K2JVMCompilerArgu
val jvmTarget = JvmTarget.fromString(jvmTargetValue)
if (jvmTarget != null) {
put(JVMConfigurationKeys.JVM_TARGET, jvmTarget)
if (jvmTarget == JvmTarget.JVM_1_6 && !isJvmTarget6Allowed()) {
if (jvmTarget == JvmTarget.JVM_1_6) {
messageCollector.report(
ERROR,
"JVM target 1.6 is no longer supported. Please migrate to JVM target 1.8 or above"
@@ -378,6 +378,3 @@ private val CompilerConfiguration.messageCollector: MessageCollector
private fun getJavaVersion(): Int =
System.getProperty("java.specification.version")?.substringAfter('.')?.toIntOrNull() ?: 6
private fun isJvmTarget6Allowed(): Boolean =
K2JVMCompiler::class.java.classLoader.getResource("META-INF/unsafe-allow-jvm6") != null
-1
View File
@@ -64,7 +64,6 @@ fun updateCompilerXml() {
"libraries/tools/maven-archetypes",
"libraries/tools/mutability-annotations-compat",
"libraries/tools/script-runtime",
"libraries/tools/stdlib-compiler-classpath",
"native/commonizer-api",
"libraries/examples",
"libraries/tools/kotlin-gradle-plugin-idea-proto",
@@ -7,7 +7,6 @@ JvmToolchain.updateJvmTarget(project, "1.8")
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) {
@@ -1,9 +0,0 @@
plugins {
java
id("jps-compatible")
}
sourceSets {
"main" { projectDefault() }
"test" {}
}
+1 -2
View File
@@ -313,8 +313,7 @@ include ":kotlin-imports-dumper-compiler-plugin",
":kotlinx-serialization-compiler-plugin",
":kotlin-serialization",
":kotlin-serialization-unshaded",
":wasm:wasm.ir",
":libraries:tools:stdlib-compiler-classpath"
":wasm:wasm.ir"
include ":kotlinx-atomicfu-compiler-plugin",