Apache Ant/Best Practices/Standard Targets

=Standard Targets=

One of the things that you learn is that if you name things consistently between projects, it is much easier to find things you are looking for. When you work with other people, you also want to have targets that you both are familiar with.

build.xml

 * Place your main build in a file called build.xml in the main directory of your project.
 * Do not put references to local file systems (Windows C:\ etc.) in your build file. Isolate these all in a local.properties file in the main directory.

Folder standards

 * - the location of your source code
 * - the output of a build process

This target should create all temporary directories within the build folder.

This target should remove all compiled and intermediate files leaving only source files. It should remove anything that can be derived from other files. This would be run just prior to creating a zip file of the project, and in case of gremlins occurring during the build process.

This target should compile sources and perform transforms of raw data.

The install target should be used to copy files to a testing or production system.

Other Standards
Use the  element to describe what your target does.

If you have more than around 100 targets in your build file, it becomes unwieldy. You could consider calling a separate build file, but that adds other complications such as the dependency between targets.