We want to build multiple zip files where some of the files have contents in common with others. Rather than specify the full list of files for each zip (they're actually quite large) I thought I would try to get some reuse.
So I tried using <union>
for this:
<project name="test" default="zips">
<target name="zips">
<union id="common">
<zipfileset prefix="." dir="." includes="1"/>
<zipfileset prefix="3" dir="." includes="2"/>
</union>
<zip zipfile="1.zip">
<resources refid="common"/>
</zip>
<zip zipfile="2.zip">
<resources refid="common"/>
</zip>
</target>
</project>
This does generate two zip files with "1" and "2" inside each, but the "3" prefix is missing from both files.
What am I doing wrong?
We also have a custom task which uses zipfileset internally. I tried to get it to work with union as well, but couldn't figure out how to get at the prefix value.