Ant, via its event framework, tracks a
variety of build-processing events using listener classes
BuildListener interface. The
design of the
BuildListener interface and its
implementation follows a pattern similar to the AWT concept of listeners. In both models, an engine
propagates events, whether the events are system or user-driven.
Classes that wish to receive these events register themselves as
listeners (in this case to the Ant engine), usually making
restrictions through interface types on the kinds of events they wish
to receive. When an event occurs, the engine tells all of the
listeners that have registered for the event type in question. Using
BuildEvent objects, the Ant engine passes detailed
information to the listeners. This communication model makes Ant the
most flexible build system available, because it
doesn’t force the user to rely on complicated
parsing of Ant’s output.
Below are the event types and their corresponding interface methods:
buildStarted event when it begins processing
the buildfile. Listeners implementing this method can perform actions
when the build starts.
buildFinished event when it has finished
processing. Nothing happens in the Ant engine after this event.
Consider this the final message for any given build.
targetStarted event just before processing a target’s ...