-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only if Modified Recipe to then run Zip or other methods #267
Comments
The issue here is that you're extracting the files in a task downloadZipFile(type: Download) {
src([
'https://github.com/michel-kraemer/gradle-download-task/archive/refs/tags/5.3.0.zip',
'https://github.com/michel-kraemer/gradle-download-task/archive/refs/tags/5.2.1.zip',
'https://github.com/michel-kraemer/gradle-download-task/archive/refs/tags/5.2.0.zip'
])
dest buildDir
}
task downloadAndUnzipFile(dependsOn: downloadZipFile, type: Copy) {
for (f in downloadZipFile.outputs.files) {
from zipTree(f)
}
into new File(buildDir, "extracted")
}
defaultTasks 'downloadAndUnzipFile' Let me know if this helps, and if so, please close the issue. Thanks. |
The recipe you provided has the same issues as the original setup. I modified the downloadZipFiles to put: I believe the behavior I am looking for is that the downloadAndUnzipFile would not be supplied a file to unzip if the file was not re-downloaded. The variable: downloadZipFile.outputs.files could be only supplied with the actual files when they are actually downloaded again. As a default task, unzipping the data alone is over 4 minutes. Both methods above stop the download if the file exists already and is not modified. That saves 30 plus minutes in our remote work environments of today. Great Product. |
OK. So, do I understand you correctly that you were able to solve the issue? |
No, The feature request is to prevent the unzip task to even run if the file is already downloaded and not modified. The current functionality is to return the files as downloaded even if they had not been downloaded due to not being modified. That causes the zip copy functions to activate which causes a delay that is not needed after initial download. |
Interesting. For me, it displays onlyIf { downloadZipFile.didWork } This way, the task will only be executed if the download task was executed too. |
That helped a lot! That worked. |
The base problem that causes this request:
I have a Download task that downloads multiple files to a directory. These files are huge and and I am able to get them to download to a subdirectory using the Download tasks and the check if modified is great. The problem is the "Extraction" phase of the download the Zip is always executing.
I am looking for an easy way to keep the easy of use of the multiple file download with a prevention of unzipping if a file is not modified.
Current Example:
Downloading and unzipping of small sets of files can be prevented individually. I have to do the copy after the download to make sure the files exist.
The request is a FLAG to prevent secondary doLasts, etc.. after based on if a file is modeled.
If there is a recipe then I apologize, I have not found one.
The text was updated successfully, but these errors were encountered: