Search in sources :

Example 1 with Tasks

use of com.thoughtworks.go.config.Tasks in project gocd by gocd.

the class BuilderMother method createBuildersAssumingAllExecTasks.

public static List<Builder> createBuildersAssumingAllExecTasks(CruiseConfig config, String pipelineName, String stageName, String jobName) {
    Tasks tasks = config.jobConfigByName(pipelineName, stageName, jobName, true).getTasks();
    ArrayList<Builder> builders = new ArrayList<>();
    for (Task task : tasks) {
        builders.add(builderFor((ExecTask) task));
    }
    return builders;
}
Also used : ExecTask(com.thoughtworks.go.config.ExecTask) Task(com.thoughtworks.go.domain.Task) Tasks(com.thoughtworks.go.config.Tasks) Builder(com.thoughtworks.go.domain.builder.Builder) ExecTask(com.thoughtworks.go.config.ExecTask) ArrayList(java.util.ArrayList)

Example 2 with Tasks

use of com.thoughtworks.go.config.Tasks in project gocd by gocd.

the class PipelineBean method getTasks.

public Tasks getTasks() {
    Tasks tasks = new Tasks();
    if ("ant".equals(builder)) {
        AntTask antTask = new AntTask();
        antTask.setTarget(this.target);
        antTask.setBuildFile(defaultString(StringUtils.isBlank(this.buildfile) ? "build.xml" : this.buildfile));
        tasks.add(antTask);
    } else if ("nant".equals(builder)) {
        NantTask nantTask = new NantTask();
        nantTask.setTarget(this.target);
        nantTask.setBuildFile(defaultString(StringUtils.isBlank(this.buildfile) ? "default.build" : this.buildfile));
        tasks.add(nantTask);
    } else if ("rake".equals(builder)) {
        RakeTask rakeTask = new RakeTask();
        rakeTask.setTarget(this.target);
        rakeTask.setBuildFile(StringUtils.isBlank(this.buildfile) ? null : this.buildfile);
        tasks.add(rakeTask);
    } else if ("exec".equals(builder)) {
        String trimmedCommand = StringUtils.defaultString(this.command).trim();
        String trimmedArguments = StringUtils.defaultString(this.arguments).trim();
        ExecTask execTask = new ExecTask(trimmedCommand, trimmedArguments, (String) null);
        tasks.add(execTask);
    }
    return tasks;
}
Also used : Tasks(com.thoughtworks.go.config.Tasks) RakeTask(com.thoughtworks.go.config.RakeTask) ExecTask(com.thoughtworks.go.config.ExecTask) AntTask(com.thoughtworks.go.config.AntTask) NantTask(com.thoughtworks.go.config.NantTask) StringUtils.defaultString(org.apache.commons.lang.StringUtils.defaultString) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Aggregations

ExecTask (com.thoughtworks.go.config.ExecTask)2 Tasks (com.thoughtworks.go.config.Tasks)2 AntTask (com.thoughtworks.go.config.AntTask)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 NantTask (com.thoughtworks.go.config.NantTask)1 RakeTask (com.thoughtworks.go.config.RakeTask)1 Task (com.thoughtworks.go.domain.Task)1 Builder (com.thoughtworks.go.domain.builder.Builder)1 ArrayList (java.util.ArrayList)1 StringUtils.defaultString (org.apache.commons.lang.StringUtils.defaultString)1