|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.DefaultLogger
org.sandev.sandbuild.SandLogger
BuildLogger that fails the build if any
warning or error messages are logged. Since failing the build as soon
as an error or warning occurs is counterproductive, the logger waits
until the end of the build before failing. Error and warning messages
are detected by listening for BuildEvent messages with a
priority of Project.MSG_ERR or Project.MSG_WARN,
respectively.
If this turns out to be insufficient for capturing all warning or error messages, future implementations of this class may include a configurable list of strings to watch for; if any string in the watchlist appears in a build message, that message is considered an error.
While it would be nice if this class were a BuildListener and not a BuildLogger (we could add it to an ant project programmatically), we can't throw the right exception in that case.
| Field Summary | |
protected java.util.ArrayList |
errorList
List of warning/error messages we've seen so far. |
| Fields inherited from class org.apache.tools.ant.DefaultLogger |
emacsMode, err, LEFT_COLUMN_SIZE, lSep, msgOutputLevel, out |
| Constructor Summary | |
SandLogger()
|
|
| Method Summary | |
void |
buildFinished(org.apache.tools.ant.BuildEvent event)
Fail the build if there were any warnings or errors. |
protected java.lang.String |
getErrors()
Return a list of the errors + warnings in the build, if any. |
void |
messageLogged(org.apache.tools.ant.BuildEvent event)
Trap + record any warnings or errors. |
| Methods inherited from class org.apache.tools.ant.DefaultLogger |
buildStarted, formatTime, log, printMessage, setEmacsMode, setErrorPrintStream, setMessageOutputLevel, setOutputPrintStream, targetFinished, targetStarted, taskFinished, taskStarted |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.ArrayList errorList
| Constructor Detail |
public SandLogger()
| Method Detail |
public void messageLogged(org.apache.tools.ant.BuildEvent event)
DefaultLogger.messageLogged(org.apache.tools.ant.BuildEvent)public void buildFinished(org.apache.tools.ant.BuildEvent event)
DefaultLogger.buildFinished(org.apache.tools.ant.BuildEvent)protected java.lang.String getErrors()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||