Methods Summary |
---|
public void | addText(java.lang.String text)Adds descriptive text to the project.
ProjectHelper ph = ProjectHelper.getProjectHelper();
if (!(ph instanceof ProjectHelperImpl)) {
// New behavior for delayed task creation. Description
// will be evaluated in Project.getDescription()
return;
}
String currentDescription = getProject().getDescription();
if (currentDescription == null) {
getProject().setDescription(text);
} else {
getProject().setDescription(currentDescription + text);
}
|
private static void | concatDescriptions(org.apache.tools.ant.Project project, org.apache.tools.ant.Target t, java.lang.StringBuffer description)
if (t == null) {
return;
}
Vector tasks = findElementInTarget(project, t, "description");
if (tasks == null) {
return;
}
for (int i = 0; i < tasks.size(); i++) {
Task task = (Task) tasks.elementAt(i);
if (!(task instanceof UnknownElement)) {
continue;
}
UnknownElement ue = ((UnknownElement) task);
String descComp = ue.getWrapper().getText().toString();
if (descComp != null) {
description.append(project.replaceProperties(descComp));
}
}
|
private static java.util.Vector | findElementInTarget(org.apache.tools.ant.Project project, org.apache.tools.ant.Target t, java.lang.String name)
Task[] tasks = t.getTasks();
Vector elems = new Vector();
for (int i = 0; i < tasks.length; i++) {
if (name.equals(tasks[i].getTaskName())) {
elems.addElement(tasks[i]);
}
}
return elems;
|
public static java.lang.String | getDescription(org.apache.tools.ant.Project project)Return the descriptions from all the targets of
a project.
Vector targets = (Vector) project.getReference("ant.targets");
if (targets == null) {
return null;
}
StringBuffer description = new StringBuffer();
for (int i = 0; i < targets.size(); i++) {
Target t = (Target) targets.elementAt(i);
concatDescriptions(project, t, description);
}
return description.toString();
|