[K/N] Remove more ext properties

This commit is contained in:
Alexander Shabalin
2024-03-05 23:16:39 +01:00
committed by Space Team
parent 23710ac133
commit adf5331ff0
17 changed files with 80 additions and 77 deletions
+11 -13
View File
@@ -15,8 +15,7 @@ import org.jetbrains.kotlin.konan.file.File as KFile
import org.jetbrains.kotlin.konan.target.Architecture as TargetArchitecture
// These properties are used by the 'konan' plugin, thus we set them before applying it.
val distDir: File by project
val konanHome: String by extra(distDir.absolutePath)
val konanHome: String by extra(kotlinNativeDist.absolutePath)
extra["org.jetbrains.kotlin.native.home"] = konanHome
val kotlinVersion: String by rootProject.extra
@@ -36,8 +35,7 @@ googletest {
refresh = project.hasProperty("refresh-gtest")
}
val hostName: String by project
val targetList: List<String> by project
val targetList = enabledTargets(extensions.getByType<PlatformManager>())
bitcode {
allTargets {
@@ -519,15 +517,15 @@ dependencies {
runtimeBitcode(project(":kotlin-native:runtime"))
}
targetList.forEach { targetName ->
targetList.forEach { target ->
// TODO: replace with a more convenient user-facing task that can build for a specific target.
// like compileToBitcode with optional argument --target.
tasks.register("${targetName}Runtime") {
description = "Build all main runtime modules for $targetName"
tasks.register("${target}Runtime") {
description = "Build all main runtime modules for $target"
group = CompileToBitcodeExtension.BUILD_TASK_GROUP
val dependencies = runtimeBitcode.incoming.artifactView {
attributes {
attribute(TargetWithSanitizer.TARGET_ATTRIBUTE, project.platformManager.targetByName(targetName).withSanitizer())
attribute(TargetWithSanitizer.TARGET_ATTRIBUTE, target.withSanitizer())
}
}.files
dependsOn(dependencies)
@@ -537,13 +535,13 @@ targetList.forEach { targetName ->
val hostRuntime by tasks.registering {
description = "Build all main runtime modules for host"
group = CompileToBitcodeExtension.BUILD_TASK_GROUP
dependsOn("${hostName}Runtime")
dependsOn("${PlatformInfo.hostName}Runtime")
}
val hostRuntimeTests by tasks.registering {
description = "Runs all runtime tests for host"
group = CompileToBitcodeExtension.VERIFICATION_TASK_GROUP
dependsOn("${hostName}RuntimeTests")
dependsOn("${PlatformInfo.hostName}RuntimeTests")
}
tasks.named("assemble") {
@@ -551,7 +549,7 @@ tasks.named("assemble") {
}
val hostAssemble by tasks.registering {
dependsOn("${hostName}Runtime")
dependsOn("${PlatformInfo.hostName}Runtime")
}
tasks.named("clean") {
@@ -656,7 +654,7 @@ val stdlibTask = tasks.register<Copy>("nativeStdlib") {
}
}
val cacheableTargetNames: List<String> by project
val cacheableTargetNames = platformManager.hostPlatform.cacheableTargets
cacheableTargetNames.forEach { targetName ->
tasks.register("${targetName}StdlibCache", KonanCacheTask::class.java) {
@@ -668,7 +666,7 @@ cacheableTargetNames.forEach { targetName ->
dependsOn(":kotlin-native:${targetName}CrossDistRuntime")
// stdlib cache links in runtime modules from the K/N distribution.
inputs.dir("$distDir/konan/targets/$targetName/native")
inputs.dir("$kotlinNativeDist/konan/targets/$targetName/native")
}
}