English 中文(简体)
ANT Tasks - GZip
  • 时间:2024-09-17

Apache Ant Tasks - GZip


Previous Page Next Page  

Description

Gzip task creates archive based on GZip, BZip2 or XZ algorithm. Output file is generated only if it is not present or source is newer.

Properties

Sr.No Attributes & Description
1

src

The file/collection to gzip/bzip/xz. (Mandatory)

2

Destfile

the destination file to create. (Mandatory)

Example

Usage

Create build.xml with the following content:


<?xml version="1.0"?>
<project name="TutorialPoint" default="info">
   <target name="info">
      <gzip src="test.txt" destfile="text.gz" />
      <echo>File archived.</echo>
   </target>
</project>

Output

Create a text.txt file with some content in the same folder. Now running Ant on the above build file produces the following output −


F:	utorialspointant>ant
Buildfile: F:	utorialspointantuild.xml

info:
     [gzip] Building: F:	utorialspointant	ext.gz
     [echo] File archived.

BUILD SUCCESSFUL
Total time: 0 seconds

You can verify that the text.gz file created.

Advertisements