/** Exits the build immediately with a given exit code. */ public void exit(int code) { if (buildEventListener != null) { buildEventListener.triggerEvent("Exiting", code); } // Prevent system.exit during unit/integration testing if (System.getProperty("grails.cli.testing") != null || System.getProperty("grails.disable.exit") != null) { throw new ScriptExitException(code); } GrailsConsole.getInstance().flush(); System.exit(code); }
public void targetFinished(BuildEvent buildEvent) { String targetName = buildEvent.getTarget().getName(); String eventName = GrailsNameUtils.getClassNameRepresentation(targetName) + "End"; triggerEvent(eventName, binding); }
/** * Triggers and event for the given name and binding * * @param eventName The name of the event */ public void triggerEvent(String eventName) { triggerEvent(eventName, binding); }