当前位置: 首页>>代码示例>>Java>>正文


Java Task.perform方法代码示例

本文整理汇总了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();
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:ElseTask.java

示例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();
      }
   }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:IfTask.java

示例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());
            }
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:31,代码来源:Foreach.java

示例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();
        }
    }
}
 
开发者ID:wso2,项目名称:andes,代码行数:22,代码来源:Foreach.java

示例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");
        }
    }
}
 
开发者ID:rectangularsoftware,项目名称:rectangular-antlib,代码行数:24,代码来源:Once.java

示例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());
        }
    }
}
 
开发者ID:ModelN,项目名称:build-management,代码行数:25,代码来源:Repeat.java

示例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();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ForEach.java

示例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();
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:8,代码来源:Assert.java

示例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;
         }
      }
   }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:Case.java

示例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");
}
 
开发者ID:apache,项目名称:groovy,代码行数:9,代码来源:SpoofTaskContainer.java

示例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.");
	}
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:35,代码来源:Relentless.java

示例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();
}
 
开发者ID:apache,项目名称:ant,代码行数:15,代码来源:SpecialSeq.java

示例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());
}
 
开发者ID:pescuma,项目名称:buildhealth,代码行数:29,代码来源:BuildHealthAntTask.java

示例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();
        }
}
 
开发者ID:rimerosolutions,项目名称:ant-git-tasks,代码行数:36,代码来源:GitTasks.java

示例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();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:If.java


注:本文中的org.apache.tools.ant.Task.perform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。