Methods Summary |
---|
public void | buildFinished(org.apache.tools.ant.BuildEvent event)Cleans recorder registry.
cleanup();
|
public void | buildStarted(org.apache.tools.ant.BuildEvent event)Empty implementation required by SubBuildListener interface.
|
private void | cleanup()cleans recorder registry and removes itself from BuildListener list.
recorderEntries.clear();
getProject().removeBuildListener(this);
|
public void | execute()The main execution.
if (filename == null) {
throw new BuildException("No filename specified");
}
getProject().log("setting a recorder for name " + filename,
Project.MSG_DEBUG);
// get the recorder entry
RecorderEntry recorder = getRecorder(filename, getProject());
// set the values on the recorder
recorder.setMessageOutputLevel(loglevel);
recorder.setEmacsMode(emacsMode);
if (start != null) {
if (start.booleanValue()) {
recorder.reopenFile();
recorder.setRecordState(start);
} else {
recorder.setRecordState(start);
recorder.closeFile();
}
}
|
protected RecorderEntry | getRecorder(java.lang.String name, org.apache.tools.ant.Project proj)Gets the recorder that's associated with the passed in name. If the
recorder doesn't exist, then a new one is created.
Object o = recorderEntries.get(name);
RecorderEntry entry;
if (o == null) {
// create a recorder entry
entry = new RecorderEntry(name);
if (append == null) {
entry.openFile(false);
} else {
entry.openFile(append.booleanValue());
}
entry.setProject(proj);
recorderEntries.put(name, entry);
} else {
entry = (RecorderEntry) o;
}
return entry;
|
public void | init()Overridden so we can add the task as build listener.
//////////////////////////////////////////////////////////////////////
// CONSTRUCTORS / INITIALIZERS
getProject().addBuildListener(this);
|
public void | messageLogged(org.apache.tools.ant.BuildEvent event)Empty implementation required by SubBuildListener interface.
|
public void | setAction(org.apache.tools.ant.taskdefs.Recorder$ActionChoices action)Sets the action for the associated recorder entry.
if (action.getValue().equalsIgnoreCase("start")) {
start = Boolean.TRUE;
} else {
start = Boolean.FALSE;
}
|
public void | setAppend(boolean append)Whether or not the logger should append to a previous file.
this.append = (append ? Boolean.TRUE : Boolean.FALSE);
|
public void | setEmacsMode(boolean emacsMode)Set emacs mode.
this.emacsMode = emacsMode;
|
public void | setLoglevel(org.apache.tools.ant.taskdefs.Recorder$VerbosityLevelChoices level)Sets the level to which this recorder entry should log to.
loglevel = level.getLevel();
|
public void | setName(java.lang.String fname)Sets the name of the file to log to, and the name of the recorder
entry.
filename = fname;
|
public void | subBuildFinished(org.apache.tools.ant.BuildEvent event)Cleans recorder registry, if this is the subbuild the task has
been created in.
if (event.getProject() == getProject()) {
cleanup();
}
|
public void | subBuildStarted(org.apache.tools.ant.BuildEvent event)Empty implementation required by SubBuildListener interface.
|
public void | targetFinished(org.apache.tools.ant.BuildEvent event)Empty implementation required by SubBuildListener interface.
|
public void | targetStarted(org.apache.tools.ant.BuildEvent event)Empty implementation required by SubBuildListener interface.
|
public void | taskFinished(org.apache.tools.ant.BuildEvent event)Empty implementation required by SubBuildListener interface.
|
public void | taskStarted(org.apache.tools.ant.BuildEvent event)Empty implementation required by SubBuildListener interface.
|