I'd like to have the download task to avoid downlo...
# community-support
g
I'd like to have the download task to avoid downloading the file if it's been already done, I'm trying with
outputs.file
but it doesn't look effective
Copy code
val downloadZipFile by registering(Download::class) {
    src("<https://github.com/mala-project/test-data/archive/refs/heads/main.zip>")
    val zip = layout.buildDirectory.file("test-data.zip")
    dest(zip)
    outputs.file(zip)
}
v
Gradle does not have a task of type
Download
If you are talking about the undercouch task, look at its documentation. 😉
g
yep, it's the undercouch plugin
v
By default, the plugin always performs a download even if the destination file already exists. If you want to prevent files from being downloaded again, use the
overwrite
flag (see description below).
g
ah, I thought I had to go through Gradle mechanism, thanks
n
https://github.com/michel-kraemer/gradle-download-task/tree/master?tab=readme-ov-file#advanced <-- check out the
useETag
setting as well. I've successfully used it to avoid repeated downloads.
👍 1