Skip to content

Commit

Permalink
buildscripts: replace Ant tasks with a de.undercouch plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 5, 2024
1 parent 2e1831f commit b18d23a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
23 changes: 4 additions & 19 deletions apps/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

plugins {
id 'application' // to build JVM applications
alias(libs.plugins.download) // to retrieve files from URLs
}

application {
Expand Down Expand Up @@ -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)
}
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

0 comments on commit b18d23a

Please sign in to comment.