Magazine
 
Introduction to Ant

Ant is a platform-independent build tool that specially supports for the Java programming language. It is written purely in Java. Ant is a powerful technique that helps the developers to convert their developmental structures in
deployment structures.

It allows the developer to automate the repeated process involved in the development of J2EE application. Developers can easily write the script to automate the build process like compilation, archiving and deployment.
A build process is an essential part of any development cycle because it removes the gap between the development, integration, and test environments. It also helps to remove other issues while deploying such as compilation, classpath, or properties that cost many
projects time and money. Ant is a free tool under the GNU License and is freely available at http://jakarta.apache.org/ant/.

There are some useful commands described in the table. These commands are built in the Ant distribution.

Command Description
Ant Used to execute another ant process from within the current one.
Copydir Used to copy an entire directory.
Copyfile Used to copy a single file.
Delete Deletes either a single file or all files in a specified directory and its sub-directories.
Deltree Deletes a directory with all its files and subdirectories.
Get Gets a file from an URL.
Jar Jars a set of files.
Java Executes a Java class within the running (Ant) VM or forks another VM if specified.
Javac Compiles a source tree within the running (Ant) VM.

 

Mkdir Makes a directory.
Property Sets a property (by name and value), or set of properties (from file or resource) in the project.
Rmic Runs the rmic compiler for a certain class.
Exec Executes a system command. When the os attribute is specified, then the command isonly executed when Ant is run on one of the specified operating systems.

Ant Data Types

There are some data types used by the ant tasks. These are described in a table given below:

Data Types Description
Argument It passes command-line arguments to programs that you invoke from an Ant buildfile.
Environment It specifies environment variables to pass to an external command or program that you execute from an Ant buildfile.
Filelist It defines a named list of files that do not necessarily need to actually exist.
Fileset It defines a named list of files that must actually exist.
Patternset It groups a set of patterns together.
Filterset It groups a set of filters together.
   

 Jan 2008 | Java Jazz Up | 39
 
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 ,

83, 84 , 85 , 86, 87 , 88, 89 , 90 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99 , 100 , 101 , 102 , 103, 104 , 105 ,

106, 107,

Download PDF