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
@@ -15,13 +15,14 @@ final File antHome = new File(buildDir, "ant-home")
final File antZip = new File(buildDir, "apache-ant-$antVersion-bin.zip")
final File antExe = new File(antHome, "apache-ant-$antVersion/bin/ant$ext")
task downloadAnt(type: Download) {
tasks.register("downloadAnt", Download) {
src antURL
dest antZip
overwrite false
}
task extractAnt(type: Sync, dependsOn: downloadAnt) {
tasks.register("extractAnt", Sync) {
dependsOn(downloadAnt)
from zipTree(antZip)
into antHome
}
@@ -26,7 +26,7 @@ dependencies {
}
final File dokkaHome = new File(buildDir, "dokka-home")
task setupDokka(type: Sync) {
tasks.register("setupDokka", Sync) {
from configurations.dokka
into dokkaHome
}
@@ -41,7 +41,8 @@ task setupCallDokka() {
dependsOn project('kotlin_big').tasks.getByName('extractLibs')
}
task callDokka(type: Exec, dependsOn: setupCallDokka) {
tasks.register("callDokka", Exec) {
dependsOn(setupCallDokka)
workingDir = projectDir
// -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
environment("ANT_OPTS", "-Xmx3G")