Apache ANT Tasks Tutorial
Selected Reading
- Ant Tasks - Discussion
- Ant Tasks - Useful Resources
- Ant Tasks - Quick Guide
- ANT Tasks -JAR
- ANT Tasks - Zip
- ANT Tasks - WAR
- ANT Tasks - Sleep
- ANT Tasks - Move
- ANT Tasks - MkDir
- ANT Tasks - LoadFile
- ANT Tasks - Length
- ANT Tasks - Javac
- ANT Tasks - Java
- ANT Tasks - Import
- ANT Tasks - Fail
- ANT Tasks - EAR
- ANT Tasks - Delete
- ANT Tasks - Copy
- ANT Tasks - Condition
- ANT Tasks - Concat
- ANT Tasks - Chmod
- ANT Tasks - GUnzip
- ANT Tasks - GZip
- ANT Tasks - BaseName
- ANT Tasks - Environment Setup
- ANT Tasks - Introduction
- ANT Tasks - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
ANT Tasks - GZip
Apache Ant Tasks - GZip
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