1. /*
  2. * Copyright 2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. package org.apache.tools.ant;
  18. /**
  19. * Instances of classes that implement this interface can register
  20. * to be also notified when things happened during a subbuild.
  21. *
  22. * <p>A subbuild is a separate project instance created by the
  23. * <code><ant></code> task family. These project instances will
  24. * never fire the buildStarted and buildFinished events, but they will
  25. * fire subBuildStarted/ and subBuildFinished. The main project
  26. * instance - the one created by running Ant in the first place - will
  27. * never invoke one of the methods of this interface.</p>
  28. *
  29. * @see BuildEvent
  30. * @see Project#addBuildListener(BuildListener)
  31. *
  32. * @since Ant 1.6.2
  33. */
  34. public interface SubBuildListener extends BuildListener {
  35. /**
  36. * Signals that a subbuild has started. This event
  37. * is fired before any targets have started.
  38. *
  39. * @param event An event with any relevant extra information.
  40. * Must not be <code>null</code>.
  41. */
  42. void subBuildStarted(BuildEvent event);
  43. /**
  44. * Signals that the last target has finished. This event
  45. * will still be fired if an error occurred during the build.
  46. *
  47. * @param event An event with any relevant extra information.
  48. * Must not be <code>null</code>.
  49. *
  50. * @see BuildEvent#getException()
  51. */
  52. void subBuildFinished(BuildEvent event);
  53. }