All,
I've been driving myself insane trying to figure this one out - and going nuts with web searches. All to no avail.
First off, I am using
ANT version 1.8.2, so I don't have the 1.6.2 issues with zip and empty folders.
I am trying to create a zip file, and my script so far is as follows:
So, what this does is take the jar file that exists in {dist} and add it to the zip file, so that when it's unzipped, the jar file comes out directly, and does NOT maintain the hierarchy (ie: doesn't create a {dist} directory and put the jar file inside it). This is the behavior I want so far.
HOWEVER, I would like to know how to do the following:
- include a {config} directory and ALL the files within it except for one called "test-config.xml"
- include two separate empty directories - say {subdir1} and {subdir2}. They may or may not have files in them, but I do NOT want ANY files in those directories when they get zipped.
For that second part with the empty directories, I'm perfectly content having the zip task create those in the zip itself without necessarily creating them on the local file system. In fact, the ideal would be if they'd be in the zip file and NOT be on the local file system - but I'll take whatever method I can get that works.
So, my local file system will look like so:
dist/MyJar.jar
config/config1.xml
config/config2.xml
config/test-config.xml
subdir1/ (may or may not exist and may or may not have files in it)
subdir2/ (may or may not exist and may or may not have files in it)
I want the ZIP file, when unzipped, to result in:
MyJar.jar
config/config1.xml
config/config2.xml
subdir1/
subdir2/
How do I accomplish this? I've tried variants of fileset, dirset, zipfileset, and am failing at every attempt.
Thanks in advance...