use of com.facebook.buck.step.fs.MakeCleanDirectoryStep in project buck by facebook.
the class TrimUberRDotJava method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
Path output = context.getSourcePathResolver().getRelativePath(getSourcePathToOutput());
buildableContext.recordArtifact(output);
return ImmutableList.of(new MakeCleanDirectoryStep(getProjectFilesystem(), output.getParent()), new PerformTrimStep(context.getSourcePathResolver().getAbsolutePath(getSourcePathToOutput())), new ZipScrubberStep(getProjectFilesystem(), output));
}
use of com.facebook.buck.step.fs.MakeCleanDirectoryStep in project buck by facebook.
the class HaskellPackageRule method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
// Setup the scratch dir.
Path scratchDir = BuildTargets.getScratchPath(getProjectFilesystem(), getBuildTarget(), "%s");
steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), scratchDir));
// Setup the package DB directory.
final Path packageDb = getPackageDb();
steps.add(new RmStep(getProjectFilesystem(), packageDb, RmStep.Mode.RECURSIVE));
buildableContext.recordArtifact(packageDb);
// Create the registration file.
Path registrationFile = scratchDir.resolve("registration-file");
steps.add(getWriteRegistrationFileStep(context.getSourcePathResolver(), registrationFile, packageDb));
// Build the the package DB.
steps.add(new GhcPkgStep(context.getSourcePathResolver(), ImmutableList.of("init", packageDb.toString()), ImmutableMap.of()));
steps.add(new GhcPkgStep(context.getSourcePathResolver(), ImmutableList.of("-v0", "register", "--package-conf=" + packageDb, "--no-expand-pkgroot", registrationFile.toString()), ImmutableMap.of("GHC_PACKAGE_PATH", depPackages.values().stream().map(input -> context.getSourcePathResolver().getAbsolutePath(input.getPackageDb()).toString()).collect(Collectors.joining(":")))));
return steps.build();
}
use of com.facebook.buck.step.fs.MakeCleanDirectoryStep in project buck by facebook.
the class GwtModule method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
Path workingDirectory = outputFile.getParent();
steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), workingDirectory));
// A CopyResourcesStep is needed so that a file that is at java/com/example/resource.txt in the
// repository will be added as com/example/resource.txt in the resulting JAR (assuming that
// "/java/" is listed under src_roots in .buckconfig).
Path tempJarFolder = workingDirectory.resolve("tmp");
steps.add(new CopyResourcesStep(getProjectFilesystem(), context.getSourcePathResolver(), ruleFinder, getBuildTarget(), filesForGwtModule, tempJarFolder, context.getJavaPackageFinder()));
steps.add(new JarDirectoryStep(getProjectFilesystem(), outputFile, /* entriesToJar */
ImmutableSortedSet.of(tempJarFolder), /* mainClass */
null, /* manifestFile */
null));
buildableContext.recordArtifact(outputFile);
return steps.build();
}
use of com.facebook.buck.step.fs.MakeCleanDirectoryStep in project buck by facebook.
the class ElfSharedLibraryInterface method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
Path output = getOutputDir().resolve(getSharedAbiLibraryName());
buildableContext.recordArtifact(output);
return ImmutableList.of(new MakeCleanDirectoryStep(getProjectFilesystem(), getOutputDir()), ElfExtractSectionsStep.of(getProjectFilesystem(), objcopy.getCommandPrefix(context.getSourcePathResolver()), context.getSourcePathResolver().getAbsolutePath(input), output, SECTIONS), ElfClearProgramHeadersStep.of(getProjectFilesystem(), output), ElfSymbolTableScrubberStep.of(getProjectFilesystem(), output, /* section */
".dynsym", /* allowMissing */
false), ElfSymbolTableScrubberStep.of(getProjectFilesystem(), output, /* section */
".symtab", /* allowMissing */
true), ElfDynamicSectionScrubberStep.of(getProjectFilesystem(), output));
}
use of com.facebook.buck.step.fs.MakeCleanDirectoryStep in project buck by facebook.
the class OcamlBuild method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
Path baseArtifactDir = ocamlContext.getNativeOutput().getParent();
buildableContext.recordArtifact(baseArtifactDir);
if (!bytecodeOnly) {
buildableContext.recordArtifact(baseArtifactDir.resolve(OcamlBuildContext.OCAML_COMPILED_DIR));
}
buildableContext.recordArtifact(baseArtifactDir.resolve(OcamlBuildContext.OCAML_COMPILED_BYTECODE_DIR));
return ImmutableList.of(new MakeCleanDirectoryStep(getProjectFilesystem(), ocamlContext.getNativeOutput().getParent()), new OcamlBuildStep(context.getSourcePathResolver(), getProjectFilesystem(), ocamlContext, cCompiler.getEnvironment(context.getSourcePathResolver()), cCompiler.getCommandPrefix(context.getSourcePathResolver()), cxxCompiler.getEnvironment(context.getSourcePathResolver()), cxxCompiler.getCommandPrefix(context.getSourcePathResolver()), bytecodeOnly));
}
Aggregations