本文整理汇总了Java中org.apache.tools.ant.Task.perform方法的典型用法代码示例。如果您正苦于以下问题:Java Task.perform方法的具体用法?Java Task.perform怎么用?Java Task.perform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.Task
的用法示例。
在下文中一共展示了Task.perform方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
public void execute() throws BuildException {
// execute all nested tasks
for ( Enumeration e = tasks.elements(); e.hasMoreElements(); ) {
Task task = ( Task ) e.nextElement();
if ( task instanceof Breakable ) {
task.perform();
if ( ( ( Breakable ) task ).doBreak() ) {
setBreak( true );
return ;
}
}
else {
task.perform();
}
}
}
示例2: doIf
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Do the 'if' part of the if/else.
*
* @exception BuildException Description of the Exception
*/
private void doIf() throws BuildException {
// execute all nested tasks
for ( Enumeration e = tasks.elements(); e.hasMoreElements(); ) {
Task task = ( Task ) e.nextElement();
if ( task instanceof Breakable ) {
task.perform();
if ( ( ( Breakable ) task ).doBreak() ) {
setBreak( true );
return ;
}
}
else {
task.perform();
}
}
}
示例3: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Execute this task and all nested Tasks.
*
* @exception BuildException Description of Exception
*/
public void execute() throws BuildException {
Unset unset = new Unset();
StringTokenizer st = new StringTokenizer(values, separator);
while (st.hasMoreTokens()) {
String value = st.nextToken();
value = trim ? value.trim() : value;
if (name != null) {
unset.setName(name);
unset.execute();
getProject().setProperty(name, value);
}
for (Enumeration e = tasks.elements(); e.hasMoreElements(); ) {
try {
Task task = (Task) e.nextElement();
task.perform();
}
catch (Exception ex) {
if (failOnError)
throw new BuildException(ex.getMessage());
else
log(ex.getMessage());
}
}
}
}
示例4: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
public void execute() {
validate("property", property).required().nonempty();
validate("list", property).required();
if (list.length() == 0) {
return;
}
String[] values = list.split(delim);
for (int i = 0; i < values.length; i++) {
String value = values[i];
if (stop != null && stop.length() > 0 &&
value.equals(stop)) {
break;
}
getProject().setProperty(property, value);
for (Task t : tasks) {
t.perform();
}
}
}
示例5: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
@Override
public void execute() throws BuildException
{
if (property == null || property.length() == 0)
{
throw new BuildException("Property name must be specified.");
}
else
{
String propertyValue = getProject().getProperty(property);
// If no value is specified, the tasks are performed if the property
// is set to any value. If a value is specified, the tasks are only
// performed if the property matches that value.
if (propertyValue == null)
{
for (Task task : tasks)
{
task.perform();
}
getProject().setProperty(property, "done");
}
}
}
示例6: performTasks
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Iterate through the list of tasks to execute each task.
*/
private void performTasks() throws BuildException {
try {
// executing nested tasks
for (int i = 0; i < tasks.size(); i++) {
Task currentTask = (Task) tasks.get(i);
try {
currentTask.perform();
} catch (Exception ex) {
if (failOnError) {
throw ex;
}
}
}
} catch (Exception e) {
if (failOnError) {
throw new BuildException(e.getMessage());
} else {
log(e.getMessage());
}
}
}
示例7: executeChildren
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Sets the specified property to the given value and executes the children.
*/
private void executeChildren(String value) throws BuildException {
getProject().setProperty(this.property, value);
for (Task task: this.children) {
task.perform();
}
}
示例8: executeNestedTasks
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/** Execute all nested tasks. */
private void executeNestedTasks() {
for (Enumeration e = tasks.elements(); e.hasMoreElements(); ) {
Task task = (Task) e.nextElement();
task.perform();
}
}
示例9: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Execute all nested tasks, checking for Breakables.
*
* @exception BuildException Description of Exception
*/
public void execute() throws BuildException {
Enumeration en = tasks.elements();
while ( en.hasMoreElements() ) {
Task task = (Task)en.nextElement();
task.perform();
if ( task instanceof Breakable ) {
if ( ( (Breakable)task ).doBreak() ) {
setBreak( true );
return;
}
}
}
}
示例10: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
public void execute() throws BuildException {
spoof("begin SpoofTaskContainer execute");
for (Iterator iter = tasks.iterator(); iter.hasNext();) {
Task task = (Task) iter.next();
task.perform();
}
spoof("end SpoofTaskContainer execute");
}
示例11: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* This method will be called when it is time to execute the task.
*/
public void execute() throws BuildException {
int failCount = 0;
int taskNo = 0;
if (taskList.size() == 0) {
throw new BuildException("No tasks specified for <relentless>.");
}
log("Relentlessly executing: " + this.getDescription());
Iterator iter = taskList.iterator();
while (iter.hasNext()) {
Task t = (Task) iter.next();
taskNo++;
String desc = t.getDescription();
if (desc == null) {
desc = "task " + taskNo;
}
if (!terse)
log("Executing: " + desc);
try {
t.perform();
} catch (BuildException x) {
log("Task " + desc + " failed: " + x.getMessage());
failCount++;
}
}
if (failCount > 0) {
throw new BuildException(
"Relentless execution: " + failCount + " of " + taskList.size() + " tasks failed.");
} else {
log("All tasks completed successfully.");
}
}
示例12: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Execute all nestedTasks.
*/
public void execute() throws BuildException {
if (fileset == null || fileset.getDir(getProject()) == null) {
throw new BuildException("Fileset was not configured");
}
for (Enumeration e = nestedTasks.elements(); e.hasMoreElements();) {
Task nestedTask = (Task) e.nextElement();
nestedTask.perform();
}
nestedEcho.reconfigure();
nestedEcho.perform();
}
示例13: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
@Override
public void execute() throws BuildException {
buildHealth = new BuildHealth(BuildHealth.findHome(home, true));
buildHealth.startNewBuild();
for (Task task : tasks)
task.perform();
Report buildReport = buildHealth.generateReport(ReportFlags.SummaryOnly | ReportFlags.ListSourcesOfProblems);
if (report)
log(new ReportFormater().writeBuildStatuses().format(buildReport).trim());
if (notify)
buildHealth.sendNotifications(new BuildHealthNotifierTracker() {
@Override
public void reportNotified(String message) {
log(message);
}
});
buildHealth.shutdown();
buildHealth = null;
if (failOnError && (buildReport == null || buildReport.getStatus() != BuildStatus.Good))
throw new BuildException(new ReportFormater().createSummaryLine(buildReport), getLocation());
}
示例14: execute
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
@Override
public void execute() throws BuildException {
if (directory == null) {
throw new BuildException("Please specify a directory attribute.");
}
for (Task task : tasks) {
GitTask t = (GitTask) task;
GitTaskUtils.validateTaskConditions(t);
if (!GitTaskUtils.isNullOrBlankString(t.getIf())) {
if (getProject().getProperty(t.getIf()) == null) {
continue;
}
}
if (!GitTaskUtils.isNullOrBlankString(t.getUnless())) {
if (getProject().getProperty(t.getUnless()) != null) {
continue;
}
}
if (!GitTaskUtils.isNullOrBlankString(settingsRef)) {
t.setSettingsRef(settingsRef);
}
if (verbose) {
t.useProgressMonitor(new GitTaskMonitor(t));
}
t.setDirectory(directory);
task.perform();
}
}
示例15: executeChildren
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Executes the child tasks.
*/
private void executeChildren() throws BuildException {
for (Task task: this.children) {
task.perform();
}
}