Folder Path "C:/apache-Ant
Folder Path "C:/apache-Ant
org
2. Unzip the zip file to a convenient location c:\folder
3. Create a new Environment variable called
User Variable: ANT_HOME and set a PATH that points to the Ant
installation folder, in this case C:\apache-ant-1.9.4
In System Variable: Path: set Ant bin folder path C:\apache-ant1.9.4\bin
4.
Check Installation
C:\>ant -versio
5. Ant's build file, called build.xml should reside in the Base/root directory of
the project. However there is no restriction on the file name or its location.
You are free to use other file names or save the build file in some other
location.
6. Sample build.xml file
<?xml version="1.0"?>
<project name="Hello World Project" default="info">
<target name="info">
<echo>Hello World - Welcome to Apache Ant!</echo>
</target>
</project>
</target>
name
depends
(Optional)
Comma separated list of all targets that this target depends on.
Adds the target to the dependency list of the specified Extension Point.
An Extension Point is similar to a target, but it does not have any tasks.
(Optional)
echo task in the above example is a trivial task that prints a message
9. To run the ant build file, open up command prompt and navigate to the
folder where the build.xml resides
10.Type ant and enter the build.xml executes
11.You can Set property name like a variable
<property name="sitename" value="www.tutorialspoint.com"/>
<property name="buildno" value="1.0.2"/>
12.You can create Ant properies file
build.properties
# The Site Name
sitename=www.tutorialspoint.com
buildversion=3.3.2