Use relative paths in stdlib klib artifacts

Intentionally use doFirst section to trick gradle and not affect
inputs with absolute path usage.

Old behaviour can be returned by kotlin.build.use.absolute.paths.in.klib
in local.properties

Should be removed after KT-50876 fix.

^KTI-730 In Progress
This commit is contained in:
Nikolay Krasko
2022-01-20 01:21:31 +03:00
committed by TeamCityServer
parent b22190ccc1
commit 87bf6e010e
2 changed files with 12 additions and 0 deletions
@@ -52,6 +52,12 @@ tasks.withType<KotlinCompile<*>>().configureEach {
"-opt-in=kotlin.ExperimentalMultiplatform",
"-opt-in=kotlin.contracts.ExperimentalContracts"
)
doFirst {
kotlinOptions.freeCompilerArgs += listOfNotNull(
"-Xklib-relative-path-base=$buildDir".takeIf { !kotlinBuildProperties.getBoolean("kotlin.build.use.absolute.paths.in.klib") }
)
}
}
tasks.named("compileKotlinJs") {
+6
View File
@@ -143,6 +143,12 @@ tasks.withType<KotlinCompile<*>>().configureEach {
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlin.ExperimentalStdlibApi"
)
doFirst {
kotlinOptions.freeCompilerArgs += listOfNotNull(
"-Xklib-relative-path-base=$buildDir".takeIf { !kotlinBuildProperties.getBoolean("kotlin.build.use.absolute.paths.in.klib") }
)
}
}
val compileKotlinJs by tasks.existing(KotlinCompile::class) {