use of com.thoughtworks.go.domain.materials.tfs.TfsMaterialUpdater in project gocd by gocd.
the class TFSMaterialUpdaterTest method setUp.
@Before
public void setUp() throws Exception {
mockRevisionContext();
mockTfsMaterial();
tfsMaterialUpdater = new TfsMaterialUpdater(tfsMaterial);
}
use of com.thoughtworks.go.domain.materials.tfs.TfsMaterialUpdater in project gocd by gocd.
the class MaterialRevisions method updateToCommand.
public BuildCommand updateToCommand(String baseDir) {
List<BuildCommand> commands = new ArrayList<>();
for (MaterialRevision revision : revisions) {
Material material = revision.getMaterial();
if (material instanceof ScmMaterial) {
if (material instanceof GitMaterial) {
GitMaterialUpdater updater = new GitMaterialUpdater((GitMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else if (material instanceof HgMaterial) {
HgMaterialUpdater updater = new HgMaterialUpdater((HgMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else if (material instanceof SvnMaterial) {
SvnMaterialUpdater updater = new SvnMaterialUpdater((SvnMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else if (material instanceof PackageMaterial) {
// do nothing
} else if (material instanceof TfsMaterial) {
TfsMaterialUpdater updater = new TfsMaterialUpdater((TfsMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else if (material instanceof P4Material) {
P4MaterialUpdater updater = new P4MaterialUpdater((P4Material) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else {
commands.add(BuildCommand.fail("%s Material is not supported for new build command agent", material.getTypeForDisplay()));
}
}
}
return BuildCommand.compose(commands);
}
Aggregations