Hi Everyone. is there any alternative of ```de.und...
# gradle
s
Hi Everyone. is there any alternative of
Copy code
de.undercouch.gradle.tasks.download.Download
This is task.register
Copy code
tasks.register<Download>("downloadBundleTools") {
    src("<https://github.com/google/bundletool/releases/download/1.5.0/bundletool-all-1.5.0.jar>")
    dest(File(buildDir, "bundletool-all.jar"))
}
h
Yes:
Copy code
tasks.register("downloadLicensesJson", Copy) {
Copy code
from(resources.text.fromUri("<https://spdx.org/licenses/licenses.json>").asFile()) {
    rename {
     "my-file-name.txt"
    }
  }
  into(myFolder)
}
🆒 1
But if you want to use the jar as dependency, you could also setup a custom ivy repository.
s
Thanks @hfhbd
g
I recommend to use Gradle dependencies mechanism for this with custom repository as Philip suggested, not use download task Because it looks closer to dependency semantics (something required for build), rather that output of a task The issue with Download or Copy task, that you have to redownload it every time after "clean", not shared across projects, not saved to dependencies cache and if you use build cache, it actually pollutes it We migrated from Download on all our cases when noticed how much time we redownload custom dependency
a
Please consider upvoting this issue in Gradle as well: https://github.com/gradle/gradle/issues/28530