Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make’s wrinkles.Build tool is used to build a fully installable application from the source code.Build Tool is an inevitable component of Release engineering.

Prerequisites

JAVA 1.4 or above

Steps to install ANT and Run a simple Hello world  ANT script

1. Download ANT 1.7.1 from ant.apache.org, unzip it to a directory
2. Make sure JAVA_HOME is set on your windows PC c:\>echo %JAVA_HOME%
3. Set ANT_HOME in windows environment variables
4. Set PATH for ANT, C:\ant.1.7.1\bin
5. Go to command prompt test your ant installation by typing c:\> ant

Buildfile: build.xml does not exist!
Build failed

this error is because , by default ant try to find a build.xml file in current working dir.

6. Create a build.xml and place it on current dir. and run ant again.
7. All set
8. try this ant -f build1.xml goodbye

Command reference

http://ant.apache.org/manual/index.html

— build.xml ——–
<project name=”hello” default=”hello”>
<target name=”hello”>
<echo message=”Hello, World”/>
</target>
</project>

—-build1.xml ——–
<project name=”hello” default=”hello”>
<target name=”hello”>
<echo message=”Hello, World”/>
</target>

<target name=”goodbye”>
<echo message=”Goodbye, end of Hello world script”/>
</target>
</project>

For more details Visit here

Post By Editor (2,827 Posts)

Website: →

Connect