Search in sources :

Example 11 with AntTask

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

the class AntTaskRepresenter method fromJSON.

public static AntTask fromJSON(JsonReader jsonReader) {
    AntTask antTask = new AntTask();
    if (jsonReader == null) {
        return antTask;
    }
    BaseTaskRepresenter.fromJSON(jsonReader, antTask);
    jsonReader.readStringIfPresent("working_directory", antTask::setWorkingDirectory);
    jsonReader.readStringIfPresent("build_file", antTask::setBuildFile);
    jsonReader.readStringIfPresent("target", antTask::setTarget);
    return antTask;
}
Also used : AntTask(com.thoughtworks.go.config.AntTask)

Example 12 with AntTask

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

the class AntTaskRepresenter method fromJSON.

public static AntTask fromJSON(JsonReader jsonReader) {
    AntTask antTask = new AntTask();
    if (jsonReader == null) {
        return antTask;
    }
    BaseTaskRepresenter.fromJSON(jsonReader, antTask);
    jsonReader.readStringIfPresent("working_directory", antTask::setWorkingDirectory);
    jsonReader.readStringIfPresent("build_file", antTask::setBuildFile);
    jsonReader.readStringIfPresent("target", antTask::setTarget);
    return antTask;
}
Also used : AntTask(com.thoughtworks.go.config.AntTask)

Example 13 with AntTask

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

the class AntTaskBuilderTest method setup.

@BeforeEach
void setup() {
    antTask = new AntTask();
    antTaskBuilder = new AntTaskBuilder();
    execTaskBuilder = new ExecTaskBuilder();
    builderFactory = mock(BuilderFactory.class);
    resolver = mock(UpstreamPipelineResolver.class);
    taskEntension = mock(TaskExtension.class);
}
Also used : TaskExtension(com.thoughtworks.go.plugin.access.pluggabletask.TaskExtension) AntTask(com.thoughtworks.go.config.AntTask) UpstreamPipelineResolver(com.thoughtworks.go.server.service.UpstreamPipelineResolver) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 14 with AntTask

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

the class AntTaskBuilderTest method antTaskShouldNormalizeWorkingDirectory.

@Test
@DisabledOnOs(OS.WINDOWS)
void antTaskShouldNormalizeWorkingDirectory() {
    AntTask task = new AntTask();
    task.setWorkingDirectory("folder1\\folder2");
    CommandBuilder commandBuilder = (CommandBuilder) antTaskBuilder.createBuilder(builderFactory, task, ExecTaskBuilderTest.pipelineStub("label", "/var/cruise-agent/pipelines/cruise"), resolver);
    assertThat(commandBuilder.getWorkingDir().getPath()).isEqualTo("/var/cruise-agent/pipelines/cruise/folder1/folder2");
}
Also used : AntTask(com.thoughtworks.go.config.AntTask) CommandBuilder(com.thoughtworks.go.domain.builder.CommandBuilder) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Aggregations

AntTask (com.thoughtworks.go.config.AntTask)14 ExecTask (com.thoughtworks.go.config.ExecTask)7 Test (org.junit.Test)6 FetchTask (com.thoughtworks.go.config.FetchTask)5 PluggableViewModel (com.thoughtworks.go.plugins.presentation.PluggableViewModel)5 Test (org.junit.jupiter.api.Test)3 FetchPluggableArtifactTask (com.thoughtworks.go.config.FetchPluggableArtifactTask)2 PluggableTask (com.thoughtworks.go.config.pluggabletask.PluggableTask)2 ConfigElementImplementationRegistry (com.thoughtworks.go.config.registry.ConfigElementImplementationRegistry)2 Task (com.thoughtworks.go.domain.Task)2 CommandBuilder (com.thoughtworks.go.domain.builder.CommandBuilder)2 PluginManager (com.thoughtworks.go.plugin.infra.PluginManager)2 TaskViewModel (com.thoughtworks.go.presentation.TaskViewModel)2 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 NantTask (com.thoughtworks.go.config.NantTask)1 RakeTask (com.thoughtworks.go.config.RakeTask)1 Tasks (com.thoughtworks.go.config.Tasks)1 Builder (com.thoughtworks.go.domain.builder.Builder)1 Configuration (com.thoughtworks.go.domain.config.Configuration)1 PluginConfiguration (com.thoughtworks.go.domain.config.PluginConfiguration)1