Ant and Its Targets
Ant is a grand open-source improvement tool from the Jakarta Project.Properties (that is, variables) are a very central part of Ant’s functioning. Generally, the important strings — directory names, file names, the class path — are acknowledged as <property> elements. This allows the programmer to swiftly change their value later on, even if one refers to them in numerous places. It also facilitates an easy overriding of their values, using (a) -Dfoo=bar on the command line, (b) the <ant> task, calling one ant file from another one, or (c) <property file=”…”>.
The <property file=”…”> construct is more often than not used to incorporate a file called build.properties. This is a principle used so that you can supersede default values for your local build atmosphere, without having to alter build.xml (which may, after all, be a shared file, under version control). This means that build.properties should not be under version control (add it to .cvsignore under CVS).
Property primacy in the Ant system is slightly different from the usual standards. The rule here is the first line that sets a property wins. That basically means that a value on the command line comes first, then a value set in a build.xml file, then the first value set in this file. This implies that, to be effectual, build.properties must be included very early in the script.
You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.