| |

Ant tool for Java

what is ant tool ?

1) Ant is a java based build tool to automate build process.

more clearly says …

Ant is an open-source Java-based build tool from the Apache Software Foundation. It’s rapidly become the  build tool for J2EE projects, so for developers, it’s certainly worth becoming familiar with the basics of Ant, at the very least. Many modern Java development environments also feature Ant support.

what is build tool ?

— A build tool provides a mechanism to describe the operations and structure of the build process. When the build tool is invoked it uses this description, examines the current state of affairs to determine the steps that need to be executed and in which order, and then manages the execution of those steps.

2) Converting an application from source files and support files into built jars or web application directories often requires complex build scripts. Ant is a build tool which lets you define and manage the build process cross-platform.

3)Ant largely inherits Java’s platform independence. This means that Ant’s build files can be easily moved from one platform to another.

4)Ant build files are portable across platforms since they don’t include shell commands .

5)Ant build files are written in XML so you don’t have to get tabs and spaces right.

Coming to the general discussion ,ant tool used to write procedures in XML,

this procedure guide the build process in compiling ,loading libraries ,deploying .. etc.,

if you are using any IDE for developing your applications you can find the build.xml file

open the file then you can find xml script for your project .

Ant script like this in most cases :

The three basic concepts in Ant are the project, targets and tasks. Actually, there are also properties, but who ever heard of good things coming in fours? The concepts are really simple: each Ant build file contains one and only one project, and that project must contain at least one target, but will usually contain more. Also, each target contains tasks. Let’s take a look at the project part of all that by diving right in and starting to write a build file.

Use a text editor to create a new file named build.xml and save it somewhere. You can use Notepad for this task, or you can use a fancy syntax-highlighting editor — it really doesn’t matter. Type or paste in the following:

<?xml version="1.0" encoding="UTF-8"?>
<project name="helloworld" default="compile" basedir=".">
<description>
Build file for the Hello World application.
</description>
</project>

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *