[GRADLE-1153] Gradle can't handle empty directories for a zip task Created: 19/Sep/10  Updated: 04/Jan/13  Resolved: 19/Apr/11

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 1.0-milestone-2

Type: Improvement
Reporter: Gregory Boissinot Assignee: Peter Niederwieser
Resolution: Fixed Votes: 2

Attachments: Zip Archive zipEmptyDir.zip    


With the following code:

apply plugin:'base'
task myzip(type:Zip)

{ from 'resources' }

the generated zip file doesn't contain empty directories in the 'resources' directory

Comment by Russ Egan [ 24/Jan/11 ]

Ran into this too. Haven't figured out a workaround. Need to create some empty folders inside a tar. Well, I guess one workaround would be using a Copy task + mkdirs(), then tar it all up, but would be nice if there was an easier way to do this, both in archive and copy tasks.

Comment by Russ Egan [ 17/Feb/11 ]

ran into another thing I'd like to be able to do with Tars, setting the uid and gid. Added another ticket for that. But as a general escape valve for stuff, could the TarCopySpecVisitor (and other visitors like it) have a hook that gives me access to the TarEntry objects, via a closure or Action? Then I could workaround this stuff.

Comment by Peter Niederwieser [ 19/Apr/11 ]

GRADLE-1295 fixes this. Empty directories are now copied by default; disable with includeEmptyDirs = false.

Comment by Russ Egan [ 13/May/11 ]

What if the example above was:

apply plugin: 'base'
task myzip(type:Zip)

{ into 'resources' }

The intent being to create a zip file containing a single, empty folder named 'resources'. This doesn't work in milestone-3. Can this ticket be used for that use case, or should I open another?

Comment by Adam Murdoch [ 15/May/11 ]

@russ, please open a new issue.

Generated at Wed Jun 30 11:48:18 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.