0% found this document useful (0 votes)
28 views2 pages

Folder Path "C:/apache-Ant

1. Download Apache Ant binaries and unzip to a local folder, then set ANT_HOME environment variable to the installation folder and add its bin folder to the system PATH variable. 2. An Ant build file called build.xml can be placed in the project root directory and contains targets with dependencies that define the build process. 3. To run the build, open a command prompt, navigate to the project folder, and type "ant" to execute the default target specified in build.xml.

Uploaded by

dba_123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views2 pages

Folder Path "C:/apache-Ant

1. Download Apache Ant binaries and unzip to a local folder, then set ANT_HOME environment variable to the installation folder and add its bin folder to the system PATH variable. 2. An Ant build file called build.xml can be placed in the project root directory and contains targets with dependencies that define the build process. 3. To run the build, open a command prompt, navigate to the project folder, and type "ant" to execute the default target specified in build.xml.

Uploaded by

dba_123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Download the binaries from http://ant.apache.

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>

name The Name of the project. (Optional)


default
The default target for the build script. A project may
contain any number of targets. This attribute specifies which target
should be considered as the default. (Mandatory)
basedir
The base directory (or) the root folder for the project.
(Optional)
7. Targets can have dependencies on other targets
a deploy target may have a dependency on the package target, the package
target may have a dependency on the compile target and so forth.
8. Dependencies are denoted using the depends attribute. For example:
<target name="deploy" depends="package">
....
</target>
<target name="package" depends="clean,compile">
....
</target>
<target name="clean" >
....
</target>
<target name="compile" >
....

</target>

name

The name of the target (Required)

depends
(Optional)

Comma separated list of all targets that this target depends on.

description A short description of the target. (optional)


if
Allows the execution of a target based on the trueness of a conditional
attribute. (optional)
unless

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

You might also like