How can I use Ant to create zip containing all the files and nested directories inside some root directory, but exclude the top-level directory itself from the zip.
For example, say I have this file structure:
/foo
splat.js
/bar
wheee.css
I want the zip to contain splat, and wheee inside /bar, but I don't want all that to be contained inside a 'foo' directory. In other words, unzipping this into /honk should not create a foo directory; splat and bar should end up at the root of /honk.
I'm currently using this (extraneous details removed):
<zip destfile="${zipfile}" basedir="" includes="${distRoot}/**/*.*" />
What kind of fileset select can replace that 'includes' spec to achieve this?
Best Solution
It's not dynamic, but using the fullpath attribute allows you to define the path struture of the zip file. See ant documentation: http://ant.apache.org/manual/Types/zipfileset.html
This may get you want you want dynamically. It should pull in everything in the foo dir then zip it up. It's just a few extra steps.