[K/N] Remove more ext properties
This commit is contained in:
committed by
Space Team
parent
23710ac133
commit
adf5331ff0
@@ -5,12 +5,13 @@
|
||||
|
||||
import org.jetbrains.kotlin.gradle.plugin.konan.tasks.KonanCacheTask
|
||||
import org.jetbrains.kotlin.gradle.plugin.tasks.KonanInteropTask
|
||||
import org.jetbrains.kotlin.PlatformInfo
|
||||
import org.jetbrains.kotlin.kotlinNativeDist
|
||||
import org.jetbrains.kotlin.konan.target.*
|
||||
import org.jetbrains.kotlin.konan.util.*
|
||||
|
||||
// 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)
|
||||
val jvmArgs: String by extra(
|
||||
mutableListOf<String>().apply {
|
||||
addAll(HostManager.defaultJvmArgs)
|
||||
@@ -22,6 +23,7 @@ extra["org.jetbrains.kotlin.native.home"] = konanHome
|
||||
extra["konan.jvmArgs"] = jvmArgs
|
||||
|
||||
plugins {
|
||||
id("platform-manager")
|
||||
id("konan")
|
||||
}
|
||||
|
||||
@@ -40,11 +42,9 @@ if (HostManager.host == KonanTarget.MACOS_ARM64) {
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_17_0)
|
||||
}
|
||||
|
||||
val konanTargetList: List<KonanTarget> by project
|
||||
val targetList: List<String> by project
|
||||
val cacheableTargets: List<KonanTarget> by project
|
||||
val cacheableTargetNames = platformManager.hostPlatform.cacheableTargets
|
||||
|
||||
konanTargetList.forEach { target ->
|
||||
enabledTargets(platformManager).forEach { target ->
|
||||
val targetName = target.visibleName
|
||||
val installTasks = mutableListOf<TaskProvider<out Task>>()
|
||||
val cacheTasks = mutableListOf<TaskProvider<out Task>>()
|
||||
@@ -84,7 +84,7 @@ konanTargetList.forEach { target ->
|
||||
}
|
||||
installTasks.add(klibInstallTask)
|
||||
|
||||
if (target in cacheableTargets) {
|
||||
if (target.name in cacheableTargetNames) {
|
||||
val cacheTask = tasks.register("${libName}Cache", KonanCacheTask::class.java) {
|
||||
notCompatibleWithConfigurationCache("project used in execution time")
|
||||
this.target = targetName
|
||||
@@ -112,7 +112,7 @@ konanTargetList.forEach { target ->
|
||||
dependsOn(installTasks)
|
||||
}
|
||||
|
||||
if (target in cacheableTargets) {
|
||||
if (target.name in cacheableTargetNames) {
|
||||
tasks.register("${targetName}Cache") {
|
||||
dependsOn(cacheTasks)
|
||||
|
||||
@@ -122,14 +122,12 @@ konanTargetList.forEach { target ->
|
||||
}
|
||||
}
|
||||
|
||||
val hostName: String by project
|
||||
|
||||
val hostInstall by tasks.registering {
|
||||
dependsOn("${hostName}Install")
|
||||
dependsOn("${PlatformInfo.hostName}Install")
|
||||
}
|
||||
|
||||
val hostCache by tasks.registering {
|
||||
dependsOn("${hostName}Cache")
|
||||
dependsOn("${PlatformInfo.hostName}Cache")
|
||||
}
|
||||
|
||||
val cache by tasks.registering {
|
||||
|
||||
Reference in New Issue
Block a user