C.104 ZipTask

The ZipTask creates a .zip archive from a fileset or directory.

Table C.136: Attributes

destfileString.ZIP filenamen/aYes
basedirStringBase directory to zip (if no fileset specified, entire directory contents will be included in the archive)noneNo
prefixStringFile path prefix to use when adding files to zipnoneNo
includeemptydirsBooleanIf set to true, also empty directories are copied. trueNo
commentStringComment to add to the zip archivenoneNo
ignorelinksBooleanWhether to ignore symlinks or not.falseNo

Important note: using basedir and fileset simultaneously can result in strange contents in the archive.

C.104.1 Example

<zip destfile="phing.zip">
 <fileset dir=".">
     <include name="**/**" />

The above example uses a fileset to determine which files to include in the archive.

<zip destfile="phing.zip" basedir="."/>

The second example uses the basedir attribute to include the contents of that directory (including subdirectories) in the archive.

C.104.2 Supported Nested Tags