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;
}
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;
}
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);
}
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");
}
Aggregations