Adopt configuration-avoidance where possible

Before this change `./gradlew help` (with native enabled)
Created immediately: 1322
Created during configuration: 1541

after this change:
Created immediately: 596
Created during configuration: 1509

To know more about configuration avoidance: https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
This commit is contained in:
cristiangarcia
2023-06-06 14:27:42 +00:00
committed by Space Team
parent ad8909113d
commit 46d113605b
33 changed files with 623 additions and 609 deletions
+3 -3
View File
@@ -82,7 +82,7 @@ def platformManager = rootProject.project(":kotlin-native").ext.platformManager
platformManager.enabled.each { target ->
def loader = platformManager.loader(target)
task "${target}Dependencies"(type: NativeDep) {
tasks.register("${target}Dependencies", NativeDep) {
konanPropertiesLoader = loader
}
@@ -107,13 +107,13 @@ platformManager.enabled.each { target ->
}
}
task update {
tasks.register("update") {
dependsOn tasks.withType(NativeDep)
mustRunAfter(tasks.withType(NativeDep))
}
rootProject.project(":kotlin-native").ext.nativeDependencies = tasks.withType(NativeDep)
task rmDotKonan(type: Delete) {
tasks.register("rmDotKonan", Delete) {
def dir = System.getenv("KONAN_DATA_DIR") ?: "${System.getProperty("user.home")}/.konan"
delete dir
}