- ANT Tasks - Home
- ANT Tasks - Introduction
- ANT Tasks - Environment Setup
- Apache ANT Tasks Examples
- ANT Tasks - BaseName
- ANT Tasks - GZip
- ANT Tasks - GUnzip
- ANT Tasks - Chmod
- ANT Tasks - Concat
- ANT Tasks - Condition
- ANT Tasks - Copy
- ANT Tasks - Delete
- ANT Tasks - EAR
- ANT Tasks - Fail
- ANT Tasks - Import
- ANT Tasks - Java
- ANT Tasks - Javac
- ANT Tasks - Length
- ANT Tasks - LoadFile
- ANT Tasks - MkDir
- ANT Tasks - Move
- ANT Tasks - Sleep
- ANT Tasks - WAR
- ANT Tasks - Zip
- ANT Tasks -JAR
- Apache ANT Tasks Useful Resources
- Ant Tasks - Quick Guide
- Ant Tasks - Useful Resources
- Ant Tasks - Discussion
Apache Ant - GZip Task
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:\tutorialspoint\ant>ant
Buildfile: F:\tutorialspoint\ant\build.xml
info:
[gzip] Building: F:\tutorialspoint\ant\text.gz
[echo] File archived.
BUILD SUCCESSFUL
Total time: 0 seconds
You can verify that the text.gz file created.
Advertisements