NAnt SDK Documentation - v0.92 |

# ZipTask Class

Creates a zip file from the specified filesets.

For a list of all members of this type, see ZipTask Members.

System.Object
NAnt.Core.Element
NAnt.Core.Task
NAnt.Compression.Tasks.ZipTask

[Visual Basic]
<TaskName(Name:="zip")>
Public Class ZipTask
Inherits Task
[C#]
[TaskName(Name="zip")]
public class ZipTask : Task

#### Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

#### Remarks

Uses #ziplib (SharpZipLib), an open source Tar/Zip/GZip library written entirely in C#.

#### Example

Zip all files in `${build.dir}` and `${doc.dir}` into a file called "backup.zip".

    <zip zipfile="backup.zip">
        <fileset basedir="${bin.dir}" prefix="bin">
            <include name="**/*" />
        </fileset>
        <fileset basedir="${doc.dir}" prefix="doc">
            <include name="**/*" />
        </fileset>
    </zip>

#### Requirements

Namespace: NAnt.Compression.Tasks

Assembly: NAnt.CompressionTasks (in NAnt.CompressionTasks.dll)

#### See Also

ZipTask Members | NAnt.Compression.Tasks Namespace