[Build] Migrate most of the build logic from Project.buildDir usage

It's going to be deprecated in Gradle 8.3

There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
This commit is contained in:
Alexander.Likhachev
2023-10-11 22:42:51 +02:00
committed by Space Team
parent b784544f8d
commit a19bd2ed2e
69 changed files with 328 additions and 306 deletions
+6 -6
View File
@@ -46,10 +46,10 @@ dependencies {
}
val builtinsDir = "${rootDir}/core/builtins"
val builtinsSrcDir = "${buildDir}/src/builtin-sources"
val builtinsSrcDir = "${layout.buildDirectory.get().asFile}/src/builtin-sources"
val jsDir = "${projectDir}/js"
val jsBuiltinsSrcDir = "${buildDir}/src/js-builtin-sources"
val jsBuiltinsSrcDir = "${layout.buildDirectory.get().asFile}/src/js-builtin-sources"
val commonOptIns = listOf(
"kotlin.ExperimentalMultiplatform",
@@ -473,7 +473,7 @@ kotlin {
}
}
into("$buildDir/src/wasm-builtin-sources")
into(layout.buildDirectory.dir("src/wasm-builtin-sources"))
}
}
@@ -527,7 +527,7 @@ kotlin {
val prepareKotlinTestCommonNativeSources by tasks.registering(Sync::class) {
from("../kotlin.test/common/src/main/kotlin")
from("../kotlin.test/annotations-common/src/main/kotlin")
into("$buildDir/src/native-kotlin-test-common-sources")
into(layout.buildDirectory.dir("src/native-kotlin-test-common-sources"))
}
kotlin {
@@ -642,13 +642,13 @@ tasks {
from(jsJar)
rename { _ -> "full-runtime.klib" }
// some tests expect stdlib-js klib in this location
into(rootProject.buildDir.resolve("js-ir-runtime"))
into(rootProject.layout.buildDirectory.dir("js-ir-runtime"))
}
val jsRearrangedSourcesJar by registering(Jar::class) {
archiveClassifier.set("js-sources")
archiveVersion.set("")
destinationDirectory.set(file("$buildDir/lib"))
destinationDirectory.set(layout.buildDirectory.dir("lib"))
includeEmptyDirs = false
duplicatesStrategy = DuplicatesStrategy.FAIL