Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com

If you're familiar with makefiles, you're halfway there.

Apache's Ant is a Java tool, that can copy files, rename them, delete them, make directories, zip files into jar, war or ear, compile sources, run Java applications and much more.

The tasks to be performed are written in a build.xml file.

If you run Ant without arguments, it will lookup the build.xml in the current directory and start with the default target.

'depends' indicates that the tasks in target 'cpf' must be executed beforehand.

Create a directory, no problem if it exists already.

Copy files...

from this directory ( property's value replaces ${dr} )...

to this directory...

except these files, including those in subdirectories ( **/ ) ...

even when they're older than files already present at the destination.

Then it's target 'doit' 's turn.

Zip files from somedir into some.zip .

Delete this directory, including all files and subdirectories.

Compile all java source files in 'anotherdir' and store the resulting binaries in the freshly created 'classdir' .

To run Ant in Eclipse, select build.xml in the project window (package explorer or navigator). Then choose ...
Run, External Tools, Run As, Ant Build.

======

NOTES

======

You can override this property's value by adding an argument like this when starting Ant :

======

Tu run a specific target, pass the target's name as argument.

======

When developing a build.xml file, I strongly advise you use the -v (verbose) argument when testing it, to see precisely what Ant is doing. Eclipse :
Run, External Tools, External Tools..., Main, Arguments .

======

basedir="." , current directory.

.