/** * Send a "build started" event * to the build listeners for this project. */ public void fireBuildStarted() { final BuildEvent event = new BuildEvent(this); for (BuildListener currListener : listeners) { currListener.buildStarted(event); } }
/** * Send a "target started" event to the build listeners * for this project. * * @param target The target which is starting to build. * Must not be <code>null</code>. */ protected void fireTargetStarted(final Target target) { final BuildEvent event = new BuildEvent(target); for (BuildListener currListener : listeners) { currListener.targetStarted(event); } }
/** * Send a "subbuild started" event to the build listeners for * this project. * * @since Ant 1.6.2 */ public void fireSubBuildStarted() { final BuildEvent event = new BuildEvent(this); for (BuildListener currListener : listeners) { if (currListener instanceof SubBuildListener) { ((SubBuildListener) currListener).subBuildStarted(event); } } }
/** * Send a "task started" event to the build listeners * for this project. * * @param task The target which is starting to execute. * Must not be <code>null</code>. */ protected void fireTaskStarted(final Task task) { // register this as the current task on the current thread. registerThreadTask(Thread.currentThread(), task); final BuildEvent event = new BuildEvent(task); for (BuildListener currListener : listeners) { currListener.taskStarted(event); } }
/** * Send a "message logged" project level event * to the build listeners for this project. * * @param project The project generating the event. * Should not be <code>null</code>. * @param message The message to send. Should not be <code>null</code>. * @param throwable The exception that caused this message. May be <code>null</code>. * @param priority The priority of the message. * @since 1.7 */ protected void fireMessageLogged(final Project project, final String message, final Throwable throwable, final int priority) { final BuildEvent event = new BuildEvent(project); event.setException(throwable); fireMessageLoggedEvent(event, message, priority); }
/** * Send a "message logged" task level event * to the build listeners for this project. * * @param task The task generating the event. * Must not be <code>null</code>. * @param message The message to send. Should not be <code>null</code>. * @param throwable The exception that caused this message. May be <code>null</code>. * @param priority The priority of the message. * @since 1.7 */ protected void fireMessageLogged(final Task task, final String message, final Throwable throwable, final int priority) { final BuildEvent event = new BuildEvent(task); event.setException(throwable); fireMessageLoggedEvent(event, message, priority); }
/** * Send a "task finished" event to the build listeners for this * project. * * @param task The task which has finished executing. * Must not be <code>null</code>. * @param exception an exception indicating a reason for a build * failure. May be <code>null</code>, indicating * a successful build. */ protected void fireTaskFinished(final Task task, final Throwable exception) { registerThreadTask(Thread.currentThread(), null); System.out.flush(); System.err.flush(); final BuildEvent event = new BuildEvent(task); event.setException(exception); for (BuildListener currListener : listeners) { currListener.taskFinished(event); } }
/** * Send a "subbuild finished" event to the build listeners for * this project. * @param exception an exception indicating a reason for a build * failure. May be <code>null</code>, indicating * a successful build. * * @since Ant 1.6.2 */ public void fireSubBuildFinished(final Throwable exception) { final BuildEvent event = new BuildEvent(this); event.setException(exception); for (BuildListener currListener : listeners) { if (currListener instanceof SubBuildListener) { ((SubBuildListener) currListener).subBuildFinished(event); } } }
/** * Send a "target finished" event to the build listeners * for this project. * * @param target The target which has finished building. * Must not be <code>null</code>. * @param exception an exception indicating a reason for a build * failure. May be <code>null</code>, indicating * a successful build. */ protected void fireTargetFinished(final Target target, final Throwable exception) { final BuildEvent event = new BuildEvent(target); event.setException(exception); for (BuildListener currListener : listeners) { currListener.targetFinished(event); } }
/** * Send a "message logged" target level event * to the build listeners for this project. * * @param target The target generating the event. * Must not be <code>null</code>. * @param message The message to send. Should not be <code>null</code>. * @param throwable The exception that caused this message. May be <code>null</code>. * @param priority The priority of the message. * @since 1.7 */ protected void fireMessageLogged(final Target target, final String message, final Throwable throwable, final int priority) { final BuildEvent event = new BuildEvent(target); event.setException(throwable); fireMessageLoggedEvent(event, message, priority); }
/** * Send a "build finished" event to the build listeners * for this project. * @param exception an exception indicating a reason for a build * failure. May be <code>null</code>, indicating * a successful build. */ public void fireBuildFinished(final Throwable exception) { final BuildEvent event = new BuildEvent(this); event.setException(exception); for (BuildListener currListener : listeners) { currListener.buildFinished(event); } // Inform IH to clear the cache IntrospectionHelper.clearCache(); }
@Override public void messageLogged(BuildEvent event) { //By Default echo is WARN level, but we want to have it as INFO if(event.getTask() instanceof Echo){ Echo echo = (Echo)event.getTask(); if(event.getPriority() == MSG_WARN){ echo.setLevel(ECHO_LEVEL_INFO); BuildEvent newevent = new BuildEvent(echo); newevent.setMessage(event.getMessage(), MSG_INFO); event = newevent; } } super.messageLogged(event); } }