Methods Summary |
---|
public void | buildFinished(org.apache.tools.ant.BuildEvent event){@inheritDoc}.
log("< BUILD FINISHED", Project.MSG_DEBUG);
if (record && out != null) {
Throwable error = event.getException();
if (error == null) {
out.println(StringUtils.LINE_SEP + "BUILD SUCCESSFUL");
} else {
out.println(StringUtils.LINE_SEP + "BUILD FAILED"
+ StringUtils.LINE_SEP);
error.printStackTrace(out);
}
}
cleanup();
|
public void | buildStarted(org.apache.tools.ant.BuildEvent event){@inheritDoc}.
log("> BUILD STARTED", Project.MSG_DEBUG);
|
public void | cleanup()
closeFile();
if (project != null) {
project.removeBuildListener(this);
}
project = null;
|
void | closeFile()Closes the file associated with this recorder.
Used by Recorder.
if (out != null) {
out.close();
out = null;
}
|
private void | flush()
if (record && out != null) {
out.flush();
}
|
private static java.lang.String | formatTime(long millis)
long seconds = millis / 1000;
long minutes = seconds / 60;
if (minutes > 0) {
return Long.toString(minutes) + " minute"
+ (minutes == 1 ? " " : "s ")
+ Long.toString(seconds % 60) + " second"
+ (seconds % 60 == 1 ? "" : "s");
} else {
return Long.toString(seconds) + " second"
+ (seconds % 60 == 1 ? "" : "s");
}
|
public java.lang.String | getFilename()
return filename;
|
private void | log(java.lang.String mesg, int level)The thing that actually sends the information to the output.
if (record && (level <= loglevel) && out != null) {
out.println(mesg);
}
|
public void | messageLogged(org.apache.tools.ant.BuildEvent event){@inheritDoc}.
log("--- MESSAGE LOGGED", Project.MSG_DEBUG);
StringBuffer buf = new StringBuffer();
if (event.getTask() != null) {
String name = event.getTask().getTaskName();
if (!emacsMode) {
String label = "[" + name + "] ";
int size = DefaultLogger.LEFT_COLUMN_SIZE - label.length();
for (int i = 0; i < size; i++) {
buf.append(" ");
}
buf.append(label);
}
}
buf.append(event.getMessage());
log(buf.toString(), event.getPriority());
|
void | openFile(boolean append)Initially opens the file associated with this recorder.
Used by Recorder.
openFileImpl(append);
|
private void | openFileImpl(boolean append)
if (out == null) {
try {
out = new PrintStream(new FileOutputStream(filename, append));
} catch (IOException ioe) {
throw new BuildException("Problems opening file using a "
+ "recorder entry", ioe);
}
}
|
void | reopenFile()Re-opens the file associated with this recorder.
Used by Recorder.
openFileImpl(true);
|
public void | setEmacsMode(boolean emacsMode){@inheritDoc}.
this.emacsMode = emacsMode;
|
public void | setErrorPrintStream(java.io.PrintStream err){@inheritDoc}.
setOutputPrintStream(err);
|
public void | setMessageOutputLevel(int level){@inheritDoc}.
if (level >= Project.MSG_ERR && level <= Project.MSG_DEBUG) {
loglevel = level;
}
|
public void | setOutputPrintStream(java.io.PrintStream output){@inheritDoc}.
closeFile();
out = output;
|
public void | setProject(org.apache.tools.ant.Project project)Set the project associated with this recorder entry.
this.project = project;
if (project != null) {
project.addBuildListener(this);
}
|
public void | setRecordState(java.lang.Boolean state)Turns off or on this recorder.
if (state != null) {
flush();
record = state.booleanValue();
}
|
public void | subBuildFinished(org.apache.tools.ant.BuildEvent event)Cleans up any resources held by this recorder entry at the end
of a subbuild if it has been created for the subbuild's project
instance.
if (event.getProject() == project) {
cleanup();
}
|
public void | subBuildStarted(org.apache.tools.ant.BuildEvent event)Empty implementation to satisfy the BuildListener interface.
|
public void | targetFinished(org.apache.tools.ant.BuildEvent event){@inheritDoc}.
log("<< TARGET FINISHED -- " + event.getTarget(), Project.MSG_DEBUG);
String time = formatTime(System.currentTimeMillis() - targetStartTime);
log(event.getTarget() + ": duration " + time, Project.MSG_VERBOSE);
flush();
|
public void | targetStarted(org.apache.tools.ant.BuildEvent event){@inheritDoc}.
log(">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG);
log(StringUtils.LINE_SEP + event.getTarget().getName() + ":",
Project.MSG_INFO);
targetStartTime = System.currentTimeMillis();
|
public void | taskFinished(org.apache.tools.ant.BuildEvent event){@inheritDoc}.
log("<<< TASK FINISHED -- " + event.getTask(), Project.MSG_DEBUG);
flush();
|
public void | taskStarted(org.apache.tools.ant.BuildEvent event){@inheritDoc}.
log(">>> TASK STARTED -- " + event.getTask(), Project.MSG_DEBUG);
|