The primary mechanism for extending the functionality of
Java-based builds with abuild is by writing hook targets (see
Section 19.1, “Ant Hooks”). There are also examples of
creating hooks in this document (Section 19.2, “Java Code Generator Example”). A build item hook
file must be called ant-hooks.xml. It is
also possible to declare ant hooks files in plugins. The plugin
ant hooks file must be called
plugin-ant.xml.
Here are some things to keep in mind when writing hook targets:
Abuild provides property names for most of the directories
that it uses. The names of these properties generally start
with abuild.private. This doesn't mean you
shouldn't reference those properties; it just means that end
users should not set them or access them in their
Abuild-ant.properties files or attempt to
override them from the command-line. They are intended to be
private to ant code that is either
user-supplied or included in abuild's
ant framework.
Abuild runs with basedir set to the
abuild output directory of the build item currently being
built. Relative paths are therefore resolved relative to that
directory. You can use any ant-supplied methods for accessing
local files, and you can use the
abuild.dir.
property for the location your own build item as provided by
abuild.
build-item-name
When adding your own hooks, please be sure to create a
properties-help hook (by creating a
-properties-help target) that describes any
additional properties your users should set in their
Abuild-ant.properties files. For an
example, see Section 19.2, “Java Code Generator Example”.
Don't be afraid to read the ant code and comments in
ant/abuild.xml under abuild's
installation directory.