Files
kotlin-fork/libraries/tools/kotlin-stdlib-docs-legacy/ant/build.gradle
T
cristiangarcia 46d113605b 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
2023-06-06 14:27:42 +00:00

32 lines
804 B
Groovy

apply plugin: 'de.undercouch.download'
apply plugin: 'base'
final String ext
if (System.getProperty('os.name', '').toLowerCase().contains('windows')) {
ext = ".bat"
} else {
ext = ""
}
final String antVersion = "1.10.12"
final String antURL = "https://cache-redirector.jetbrains.com/downloads.apache.org/ant/binaries/apache-ant-$antVersion-bin.zip"
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")
tasks.register("downloadAnt", Download) {
src antURL
dest antZip
overwrite false
}
tasks.register("extractAnt", Sync) {
dependsOn(downloadAnt)
from zipTree(antZip)
into antHome
}
project.extensions.ant_exe = antExe