ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Robert H - MWT" <>
Subject RE: just not getting it
Date Mon, 11 Aug 2003 16:22:47 GMT
Greg, In make and ant, targets are analogous. The difference is that with
make, targets are made up of a series of commands that would run in a shell
or at a command prompt. With ant, targets are made up of tasks. Tasks are
essentially the java equivalent of the commands that make up your targets in
make. Each task you are using appears as a block of xml in your build file,
where you set the parameters for each task you are calling. In your case you
would probably have several targets with one task each:

Target	Tasks
init		<mkdir>, make the build and dist directories
compile	<javac>, compile the source to the build directory
dist		<jar>, create the jar from the compiled code
clean		<delete>, delete the build and dist directories
build		depends="init,compile,dist"
clean-build depends="clean,build"

Of course you could put all these tasks into a single target, but you would
lose some flexibility...

Target	Tasks
build		<delete>, <mkdir>, <javac>, <jar>

I hope this helps.

-Rob Anderson

-----Original Message-----
From: Gregory Seidman [] 
Sent: Sunday, August 10, 2003 1:45 PM
To: Ant users mailing list
Subject: just not getting it

I'm trying to understand the basic concept of Ant, and I'm just not getting
it. Until I understand how to get Ant to compile a bunch of Java source
files and pack them all into a jar file with the correct main class in its
META-INF, it won't help me to understand how to add external tasks. I don't
even understand the meaning of task.

I'm sure that part of the problem is that I am looking at this through
make-colored glasses. I've been using make for a decade or more, and created
a pretty serious build system with it (for a graduate project and, later, a
project at work). I've been working with Java since 1995. I'm not a newbie
to software development, and I've read throug the ant FAQ and manual, yet
some crucial concept is eluding me.

Would someone please explain how to handle the simple example of a
directory/package tree full of .java source files to be built into a JAR?
Once I have that toehold, I think I can start learning the rest.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message