[GRADLE-2827] Copy tasks incorrectly consider themselves up to date when a new empty directory is added to source and ignoreEmptyDirs = false Created: 05/Jul/13 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Lari Hotari |
Resolution: | Won't Fix | Votes: | 1 |
Description |
I am trying to create a Zip file that contains a single empty direcctory with a Zip task. Am I doing something wrong here? Or is this a bug? I use the following task, where the direcctory "dirContainingEmptyDir" contains a single empty directory: task zipDirContainingEmptyDir(type: Zip) { |
Comments |
Comment by Gradle Forums [ 05/Jul/13 ] |
Hello Henning, cheers, |
Comment by Gradle Forums [ 05/Jul/13 ] |
Hi Rene, To clarify, in my example I have the following files:
Now I would expect that the task creates a Zip file that contains the directory 'emptyDir' - but this does not happen because the task is considered up-to-date. If I add a file 'test.txt' to the directory 'dirContainingEmptyDir', then everything is fine (the resulting Zip file then contains both the file 'test.txt' and the empty directory 'emptyDir'). Cheers, |
Comment by Lari Hotari [ 09/Oct/15 ] |
appears to be fixed by https://github.com/gradle/gradle/commit/db753ed6 and https://github.com/gradle/gradle/commit/afcbb6a9 , will investigate later |
Comment by Lari Hotari [ 03/Nov/15 ] |
I checked if the changes for Gradle 2.9 would make this work. There is no change for Gradle 2.9 . What made me think that this could be fixed was this issue referenced in the source code, in a test that started failing after I made the changes I mentioned in my previous comment. |
Comment by Lari Hotari [ 03/Nov/15 ] |
I checked if it would be possible to override the getSource method of the AbstractCopyTask class. That has the annotation "SkipWhenEmpty". However it's not possible to prevent using that annotation in a subclass because of the behaviour in AnnotationProcessingTaskFactory.Validator.attachActions, which always scans all annotations of superclasses regardless if the method was overridden in a subclass. |
Comment by Lari Hotari [ 03/Nov/15 ] |
There is a workaround in https://discuss.gradle.org/t/up-to-date-for-empty-inputs/9967/2 |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |