I have an ant target for creating zip like this -
<zip destfile="${dist}/myzip.zip">
<zipfileset dir="docs/manual" prefix="docs/userguide"/>
</zip>
This basically creates archive myzip.zip
with all the files and directories under docs/manual
prefixed with docs/userguide in the archive.
But I don' want to include all the directories under docs/manual
to be copied into the archive,
I have a directory called old
under docs/manual
which I want to exclude...How to achieve this?
From the ZipFileSet reference page
<zipfileset>
supports all attributes of<fileset>
in addition to those listed below.
So see FileSet for reference.
This is how you do it:
<zipfileset dir="docs/manual" prefix="docs/userguide">
<exclude name="old/**"/>
</zipfileset>
or inline as attribute:
<zipfileset dir="docs/manual" prefix="docs/userguide" exclude="old/**" />
Update: Using wildcards now instead of simple name.
you can exclude an entire directory by this:
<zipfileset dir="docs/manual" prefix="docs/userguide" exlcudes="**/old/**"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With