From b18d23a093d74b3ede9d04cfa351969e0e240c72 Mon Sep 17 00:00:00 2001 From: stephengold Date: Wed, 5 Jun 2024 11:13:55 -0700 Subject: [PATCH] buildscripts: replace Ant tasks with a de.undercouch plugin --- apps/build.gradle | 23 ++++------------------- gradle/libs.versions.toml | 2 ++ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/apps/build.gradle b/apps/build.gradle index a431136..55022e1 100644 --- a/apps/build.gradle +++ b/apps/build.gradle @@ -6,6 +6,7 @@ plugins { id 'application' // to build JVM applications + alias(libs.plugins.download) // to retrieve files from URLs } application { @@ -311,24 +312,8 @@ void registerPlatformTasks(String platform, String suffix) { delete downloadsDir + filename } - tasks.register('download' + platform, MyDownload) { - sourceUrl = libbulletjmeUrl + filename - target = file(downloadsDir + filename) - } -} - -// helper class to wrap Ant download task: - -class MyDownload extends DefaultTask { - @Input - String sourceUrl - - @OutputFile - File target - - @TaskAction - void download() { - ant.get(src: sourceUrl, dest: target) - println sourceUrl + tasks.register('download' + platform, Download) { + src libbulletjmeUrl + filename + dest file(downloadsDir + filename) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2e13d89..2ed52ed 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,3 +22,5 @@ lwjgl-vulkan = { module = "org.lwjgl:lwjgl-vulkan", version.ref = "lwjgl" } [bundles] [plugins] + +download = { id = "de.undercouch.download", version = "5.6.0" } \ No newline at end of file