use of com.facebook.buck.step.fs.MakeExecutableStep in project buck by facebook.
the class RemoteFile method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
Path tempFile = BuildTargets.getScratchPath(getProjectFilesystem(), getBuildTarget(), "%s/" + output.getFileName());
steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), tempFile.getParent()));
steps.add(new DownloadStep(getProjectFilesystem(), downloader, uri, sha1, tempFile));
steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), output.getParent()));
if (type == Type.EXPLODED_ZIP) {
steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), output));
steps.add(new UnzipStep(getProjectFilesystem(), tempFile, output));
} else {
steps.add(CopyStep.forFile(getProjectFilesystem(), tempFile, output));
}
if (type == Type.EXECUTABLE) {
steps.add(new MakeExecutableStep(getProjectFilesystem(), output));
}
buildableContext.recordArtifact(output);
return steps.build();
}
Aggregations