[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:
committed by
Space Team
parent
b784544f8d
commit
a19bd2ed2e
@@ -502,9 +502,7 @@ val hostAssemble by tasks.registering {
|
||||
}
|
||||
|
||||
tasks.named("clean") {
|
||||
doFirst {
|
||||
delete(buildDir)
|
||||
}
|
||||
delete(layout.buildDirectory)
|
||||
}
|
||||
|
||||
// region: Stdlib
|
||||
@@ -535,7 +533,7 @@ lateinit var stdlibBuildTask: TaskProvider<Task>
|
||||
|
||||
konanArtifacts {
|
||||
library("stdlib") {
|
||||
baseDir(project.buildDir.resolve("stdlib"))
|
||||
baseDir(project.layout.buildDirectory.dir("stdlib").get().asFile)
|
||||
|
||||
enableMultiplatform(true)
|
||||
noStdLib(true)
|
||||
@@ -578,9 +576,9 @@ targetList.forEach { targetName ->
|
||||
dependsOn(stdlibBuildTask)
|
||||
dependsOn("${targetName}Runtime")
|
||||
|
||||
destinationDir = project.buildDir.resolve("${targetName}Stdlib")
|
||||
into(project.layout.buildDirectory.dir("${targetName}Stdlib"))
|
||||
|
||||
from(project.buildDir.resolve("stdlib/${hostName}/stdlib"))
|
||||
from(project.layout.buildDirectory.dir("stdlib/${hostName}/stdlib"))
|
||||
val runtimeFiles = runtimeBitcode.incoming.artifactView {
|
||||
attributes {
|
||||
attribute(TargetWithSanitizer.TARGET_ATTRIBUTE, project.platformManager.targetByName(targetName).withSanitizer())
|
||||
@@ -614,7 +612,7 @@ targetList.forEach { targetName ->
|
||||
target = targetName
|
||||
originalKlib.fileProvider(stdlibTask.map { it.destinationDir })
|
||||
klibUniqName = "stdlib"
|
||||
cacheRoot = project.buildDir.resolve("cache/$targetName").absolutePath
|
||||
cacheRoot = project.layout.buildDirectory.dir("cache/$targetName").get().asFile.absolutePath
|
||||
|
||||
dependsOn(":kotlin-native:${targetName}CrossDistRuntime")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user