Ant
 
 
Ant is an open-source Java-based build tool. The configuration files are XML-based, calling out a target tree where various tasks get executed. Each task is run by an object that implements a particular Task interface.

The binary distribution of Ant includes the latest version of the Apache Xerces2 XML parser. Ant is distributed at no charge for commercial or non-commercial use. For more information read the LICENSE file.

The latest Ant version can be downloaded from: http://ant.apache.org/

rss






Examples build.xml.

Information:
none

Operating system used:
Windows XP Home Edition Version 5.1 SP 2

Software prerequisites:
Ant 1.5.1

Related information:


Procedure:
To run Ant the following commands can be used:

ant
runs Ant using the build.xml file in the current directory, on the default target.

ant -f test.xml
runs Ant using the test.xml file in the current directory, on the default target.

ant -f test.xml dist
runs Ant using the test.xml file in the current directory, on the target called dist.

ant -f test.xml -Dbuild=build/classes dist
runs Ant using the test.xml file in the current directory, on the target called dist, setting the build property to the value build/classes.

Examples:
Description Files
This script opens the Windows Notepad application.
This script works on a Windows environment.
Click here to view or right click to download build_demo1.xml.
This script creates a jar file. Click here to view or right click to download build_demo2.xml.
This script changes the modification time of all *.htm files within a specified directory. Click here to view or right click to download build_demo3.xml.
This script displays all *.htm files in a selected directory and its subdirectories. Click here to view or right click to download build_demo4.xml.
This script reads a "data.txt" file and searches in this file all lines containing the word "john". This line is added in a file called data_updated.txt. Click here to view or right click to download build_demo5.xml.
Click here to view or right click to download data_ant.txt.
This script searches within a specified directory all *.htm files. Each time a htm file has been found the HTML tidy application is applied upon this file.
This build script works on a Windows environment.
Click here to view or right click to download build_demo6.xml.
Click here to view or right click to download config_tidy.txt.
This script converts SHTML files (SSI Server Side Includes) into HTM files. Click here to view or right click to download build_demo7.xml.
This script unjar a jar file, decompiles all class files using the Jad decompiler and creates a new jar file containing the decompiled class files. Click here to view or right click to download build_demo8.xml.
This script optimizes a javascript file for download speed. It removes excess whitespace, comments and removes linebreaks from the javascript file. Click here to view or right click to download build_demo9.xml.
This script plays a sound. Click here to view or right click to download build_demo10.xml.
Download complete.wav and error.wav
This script does the following:
  • builds the java code
  • creates a jar file
  • creates an HTML file containing version information
Click here to view or right click to download build_demo11.xml.
This build script requires 2 files: version.properties and version.html
A comprehensive Ant Core Task Quick Reference has been compiled by Tim O'Brien.

The latest version of the original guide can be found at http://www.discursive.com/index.html
Click here to view or right click to download the guide.