use of com.facebook.buck.step.Step in project buck by facebook.
the class GwtBinary method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
// Create a clean directory where the .zip file will be written.
Path workingDirectory = context.getSourcePathResolver().getRelativePath(getSourcePathToOutput()).getParent();
ProjectFilesystem projectFilesystem = getProjectFilesystem();
steps.add(new MakeCleanDirectoryStep(projectFilesystem, workingDirectory));
// Write the deploy files into a separate directory so that the generated .zip is smaller.
final Path deployDirectory = workingDirectory.resolve("deploy");
steps.add(new MkdirStep(projectFilesystem, deployDirectory));
Step javaStep = new ShellStep(projectFilesystem.getRootPath()) {
@Override
public String getShortName() {
return "gwt-compile";
}
@Override
protected ImmutableList<String> getShellCommandInternal(ExecutionContext executionContext) {
ImmutableList.Builder<String> javaArgsBuilder = ImmutableList.builder();
javaArgsBuilder.add(javaRuntimeLauncher.getCommand());
javaArgsBuilder.add("-Dgwt.normalizeTimestamps=true");
javaArgsBuilder.addAll(vmArgs);
javaArgsBuilder.add("-classpath", Joiner.on(File.pathSeparator).join(Iterables.transform(getClasspathEntries(context.getSourcePathResolver()), getProjectFilesystem()::resolve)), GWT_COMPILER_CLASS, "-war", context.getSourcePathResolver().getAbsolutePath(getSourcePathToOutput()).toString(), "-style", style.name(), "-optimize", String.valueOf(optimize), "-localWorkers", String.valueOf(localWorkers), "-deploy", getProjectFilesystem().resolve(deployDirectory).toString());
if (draftCompile) {
javaArgsBuilder.add("-draftCompile");
}
if (strict) {
javaArgsBuilder.add("-strict");
}
javaArgsBuilder.addAll(experimentalArgs);
javaArgsBuilder.addAll(modules);
final ImmutableList<String> javaArgs = javaArgsBuilder.build();
return javaArgs;
}
};
steps.add(javaStep);
buildableContext.recordArtifact(context.getSourcePathResolver().getRelativePath(getSourcePathToOutput()));
return steps.build();
}
use of com.facebook.buck.step.Step in project buck by facebook.
the class HalideCompile method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
Path outputDir = context.getSourcePathResolver().getRelativePath(getSourcePathToOutput());
buildableContext.recordArtifact(objectOutputPath(getBuildTarget(), getProjectFilesystem(), functionNameOverride));
buildableContext.recordArtifact(headerOutputPath(getBuildTarget(), getProjectFilesystem(), functionNameOverride));
ImmutableList.Builder<Step> commands = ImmutableList.builder();
ProjectFilesystem projectFilesystem = getProjectFilesystem();
commands.add(new MakeCleanDirectoryStep(projectFilesystem, outputDir));
commands.add(new HalideCompilerStep(projectFilesystem.getRootPath(), halideCompiler.getEnvironment(context.getSourcePathResolver()), halideCompiler.getCommandPrefix(context.getSourcePathResolver()), outputDir, fileOutputName(getBuildTarget(), functionNameOverride), targetPlatform, compilerInvocationFlags));
return commands.build();
}
use of com.facebook.buck.step.Step 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();
}
use of com.facebook.buck.step.Step in project buck by facebook.
the class CsharpLibrary method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
ProjectFilesystem filesystem = getProjectFilesystem();
ImmutableSortedSet<Path> sourceFiles = context.getSourcePathResolver().getAllAbsolutePaths(srcs);
ImmutableListMultimap.Builder<Path, String> resolvedResources = ImmutableListMultimap.builder();
for (Map.Entry<String, SourcePath> resource : resources.entrySet()) {
resolvedResources.put(context.getSourcePathResolver().getAbsolutePath(resource.getValue()), resource.getKey());
}
ImmutableList<Either<Path, String>> references = resolveReferences(context.getSourcePathResolver(), refs);
ImmutableList.Builder<Step> steps = ImmutableList.builder();
steps.add(new MakeCleanDirectoryStep(filesystem, output.getParent()));
steps.add(new CsharpLibraryCompile(filesystem.resolve(output), sourceFiles, references, resolvedResources.build(), version));
return steps.build();
}
use of com.facebook.buck.step.Step in project buck by facebook.
the class PrebuiltDotnetLibrary method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
steps.add(new RmStep(getProjectFilesystem(), output));
steps.add(new MkdirStep(getProjectFilesystem(), output.getParent()));
steps.add(CopyStep.forFile(getProjectFilesystem(), getResolver().getAbsolutePath(assembly), output));
return steps.build();
}
Aggregations