<gzip>

The <gzip> task is used to gzip a file. It creates a gzipped version of the named source file, giving it the name supplied by the zipfile attribute. The file will not be created, however, if the zip file already exists and is newer than the source file.

<gzip> was not been designed to gzip multiple files, as the lack of support for nested filesets suggests. The most practical use of <gzip> is gzipping tar files—a common format of distribution.

A full listing of the task attributes is given in Table 4.40.

Table 4.40. Table of <gzip> Attributes
Attributes (Required) Description
src The name of the file to be gzipped.
zipfile The name of the destination file.

Example

The result of running the following would be the creation of a file named ...

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.