SubBuildListener (Apache Ant API)
Description: declaration: package: org.apache.tools.ant, interface: SubBuildListener

# Interface SubBuildListener

All Superinterfaces:
  `BuildListener, EventListener`

All Known Implementing Classes:
  `AntClassLoader, AntClassLoader2, AntClassLoader5, BigProjectLogger, Recorder, RecorderEntry, SplitClassLoader`

public interface SubBuildListener extends BuildListener
Instances of classes that implement this interface can register to be also notified when things happened during a subbuild.

A subbuild is a separate project instance created by the `<ant>` task family. These project instances will never fire the buildStarted and buildFinished events, but they will fire subBuildStarted/ and subBuildFinished. The main project instance - the one created by running Ant in the first place - will never invoke one of the methods of this interface.

Since:
  Ant 1.6.2
See Also:
  - `BuildEvent`
  - `Project.addBuildListener(BuildListener)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `subBuildFinished(BuildEvent event)`
  Signals that the last target has finished.
  `void`
  `subBuildStarted(BuildEvent event)`
  Signals that a subbuild has started.

  ### Methods inherited from interface BuildListener

  `buildFinished, buildStarted, messageLogged, targetFinished, targetStarted, taskFinished, taskStarted`
  Modifier and Type
  Method
  Description
  `void`
  `buildFinished(BuildEvent event)`
  Signals that the last target has finished.
  `void`
  `buildStarted(BuildEvent event)`
  Signals that a build has started.
  `void`
  `messageLogged(BuildEvent event)`
  Signals a message logging event.
  `void`
  `targetFinished(BuildEvent event)`
  Signals that a target has finished.
  `void`
  `targetStarted(BuildEvent event)`
  Signals that a target is starting.
  `void`
  `taskFinished(BuildEvent event)`
  Signals that a task has finished.
  `void`
  `taskStarted(BuildEvent event)`
  Signals that a task is starting.

- ## Method Details

  - ### subBuildStarted

    void subBuildStarted(BuildEvent event)
    Signals that a subbuild has started. This event is fired before any targets have started.
    Parameters:
      `event` - An event with any relevant extra information. Must not be `null`.

  - ### subBuildFinished

    void subBuildFinished(BuildEvent event)
    Signals that the last target has finished. This event will still be fired if an error occurred during the build.
    Parameters:
      `event` - An event with any relevant extra information. Must not be `null`.
    See Also:
      - `BuildEvent.getException()`