16.3. The Abuild-ant.xml File

The ant portion of the Java support in abuild is somewhat experimental. To handle those cases in which abuild's current ant support is inadequate and to facilitate experimentation with alternative approaches, abuild will also detect the build file Abuild-ant.xml. This file is mutually exclusive with Abuild-ant.properties. If it exists, abuild will bypass its internal ant structure and invoke ant on this file directly. Keep in mind, however, that it will invoke ant from the abuild-java directory as if the file were copied to a build.xml in that directory. (Abuild runs the equivalent of ant -f ../Abuild-ant.xml -Dbasedir=. from abuild-java when it sees Abuild-ant.xml.) This means that relative paths in Abuild-ant.xml are resolved from the abuild output directory. This is one of the reasons that this file is not called build.xml as that would imply that you could just run ant, which, in general, will not work. In order to work properly with abuild, this file must define a target called all that builds everything needed in order to build items that depend on it. This file should also define the other standard targets supported by abuild (see Section 11.5, “General Targets”). Even though there aren't actually any restrictions on what version of ant you could use for this alternative Java support, abuild still requires it to be 1.7 or newer. This way, you won't run into the situation of having an old version of ant and suddenly needing to upgrade because of the addition of a build item that uses abuild's included ant framework.

Note that abuild still creates the .ab-dynamic-ant.properties file in the abuild-java directory, so the hand-coded ant build file still has access to all the information from the abuild interfaces of its dependencies as well as the properties that contain the paths to those items. If you are writing an Abuild-ant.xml file, you are strongly encouraged to use this file to minimize your direct dependence on ant, the environment, and the file system layout. For an example of a build item build in this way that interoperates with abuild's default ant support, see Section 19.3, “Build.xml-driven Java Example”.