Retry download task if the destination file is missing
Under some circumstances, Gradle seems to decide that the destination file being absent is the download task's expected outcome. It caches this state, and refuses to retry the download in the future since it thinks the task is up-to-date. We can correct this by telling Gradle that the task should not be considered up-to-date if the file is missing, as recommended by <https://discuss.gradle.org/t/task-up-to-date-but-outputfile-not-created/17568/2>.
This commit is contained in:
parent
0510c914bb
commit
10d3adf324
|
@ -28,6 +28,12 @@ class VerifiedDownload extends org.gradle.api.DefaultTask {
|
|||
return project.file(dest)
|
||||
}
|
||||
|
||||
VerifiedDownload() {
|
||||
outputs.upToDateWhen {
|
||||
getDest().exists()
|
||||
}
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
downloadAndVerify() {
|
||||
def destFile = getDest()
|
||||
|
|
Loading…
Reference in New Issue