Unify kotlinCompilerClasspath for all projects

This will prevent spawning second Kotlin daemon during compilation
except 'buildSrc' compilation. Original change was introduced in
2e515f3945 commit.
This commit is contained in:
Yahor Berdnikau
2022-05-05 13:59:44 +02:00
committed by Space
parent f016fd4766
commit af6f17c243
27 changed files with 13 additions and 29 deletions
@@ -22,6 +22,8 @@ dependencies {
}
}
project.applyFixForStdlib16()
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
project.configureJvmDefaultToolchain()
project.addEmbeddedConfigurations()
@@ -99,7 +101,7 @@ fun Project.configureJavaBasePlugin() {
}
fun Project.configureKotlinCompilationOptions() {
plugins.withType<KotlinBasePluginWrapper>() {
plugins.withType<KotlinBasePluginWrapper> {
val commonCompilerArgs = listOfNotNull(
"-opt-in=kotlin.RequiresOptIn",
"-progressive".takeIf { hasProperty("test.progressive.mode") }
@@ -189,6 +191,16 @@ fun Project.configureKotlinCompilationOptions() {
}
}
// 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