use of com.thoughtworks.go.config.NantTask in project gocd by gocd.
the class NantTaskRepresenter method fromJSON.
public static NantTask fromJSON(JsonReader jsonReader) {
NantTask nantTask = new NantTask();
if (jsonReader == null) {
return nantTask;
}
BaseTaskRepresenter.fromJSON(jsonReader, nantTask);
jsonReader.readStringIfPresent("working_directory", nantTask::setWorkingDirectory);
jsonReader.readStringIfPresent("build_file", nantTask::setBuildFile);
jsonReader.readStringIfPresent("target", nantTask::setTarget);
jsonReader.readStringIfPresent("nant_path", nantTask::setNantPath);
return nantTask;
}
use of com.thoughtworks.go.config.NantTask in project gocd by gocd.
the class NantTaskBuilderTest method shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnLinux.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnLinux() {
NantTask nantTask = new NantTask();
nantTask.setNantPath("/usr/bin");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, pipeline, resolver);
assertThat(new File(builder.getCommand())).isEqualTo(new File("/usr/bin/nant"));
}
use of com.thoughtworks.go.config.NantTask in project gocd by gocd.
the class NantTaskBuilderTest method nantTaskShouldNormalizeWorkingDirectory.
@Test
@DisabledOnOs(OS.WINDOWS)
void nantTaskShouldNormalizeWorkingDirectory() {
NantTask nantTask = new NantTask();
nantTask.setWorkingDirectory("folder1\\folder2");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, ExecTaskBuilderTest.pipelineStub("label", "/var/cruise-agent/pipelines/cruise"), resolver);
assertThat(builder.getWorkingDir()).isEqualTo(new File("/var/cruise-agent/pipelines/cruise/folder1/folder2"));
}
use of com.thoughtworks.go.config.NantTask in project gocd by gocd.
the class NantTaskBuilderTest method nantTaskShouldNormalizeBuildFile.
@Test
void nantTaskShouldNormalizeBuildFile() {
NantTask task = new NantTask();
task.setBuildFile("pavan\\build.xml");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, task, pipeline, resolver);
assertThat(builder.getArgs()).isEqualTo("-buildfile:\"pavan/build.xml\"");
}
use of com.thoughtworks.go.config.NantTask in project gocd by gocd.
the class NantTaskBuilderTest method shouldUseDefaultWorkingDirectoryByDefault.
@Test
void shouldUseDefaultWorkingDirectoryByDefault() {
NantTask nantTask = new NantTask();
CommandBuilder commandBuilder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, ExecTaskBuilderTest.pipelineStub("label", "/cruise"), resolver);
assertThat(commandBuilder.getWorkingDir()).isEqualTo(new File("/cruise"));
}
Aggregations