Previous Section
Table of Contents
Next Section


Specifying Ant Properties

You need to define Ant properties to avoid namespace collisions, which occur due to inadequate naming techniques. For example, if you chain buildfiles and set the inheritsAll flag to true, namespace collisions can occur among the various build scripts. As a result, the results of a build could vary in response to the order in which the Ant targets are executed. You need to use a naming convention that guarantees uniqueness so that namespace collisions do not occur.

Java provides a naming convention to avoid class namespace collisions. According to this convention, Java prefixes all the classes with a package name. A solution for avoiding namespace collisions is to prefix all property names with the name of the component for which the build script has been created. For example, the definition of channel's source directory is <property name="channel.src" value="." />. Using this definition, you can provide uniqueness among the properties of various build scripts. If you use src as the name of the property, another build script in the chain could use the same name. By prefixing src with channel, you can avoid this collision.

You can define a set of properties with a common suffix to avoid collisions. For example, the common development environment defines the source, classes, and lib subdirectories. Each build script defines the values of these properties. If you prefix the property name with the name of the component, it allows you to predefine a set of suffixes.



Previous Section
Table of Contents
Next Section