/** * This is an override point: the message that indicates whether a build failed. * Subclasses can change/enhance the message. * * @return The classic "BUILD FAILED" plus a timestamp */ @Override protected String getBuildFailedMessage() { return super.getBuildFailedMessage() + SPACER + getTimestamp(); }
/** * Prints whether the build succeeded or failed, * any errors the occurred during the build, and * how long the build took. * * @param event An event with any relevant extra information. * Must not be <code>null</code>. */ public void buildFinished(BuildEvent event) { Throwable error = event.getException(); StringBuffer message = new StringBuffer(); if (error == null) { message.append(String.format("%n%s", getBuildSuccessfulMessage())); } else { message.append(String.format("%n%s%n", getBuildFailedMessage())); throwableMessage(message, error, Project.MSG_VERBOSE <= msgOutputLevel); } message.append(String.format("%nTotal time: %s", formatTime(System.currentTimeMillis() - startTime))); String msg = message.toString(); if (error == null) { printMessage(msg, out, Project.MSG_VERBOSE); } else { printMessage(msg, err, Project.MSG_ERR); } log(msg); }