本文整理匯總了Java中com.facebook.buck.rules.BuildableContext類的典型用法代碼示例。如果您正苦於以下問題:Java BuildableContext類的具體用法?Java BuildableContext怎麽用?Java BuildableContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BuildableContext類屬於com.facebook.buck.rules包,在下文中一共展示了BuildableContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
Path binPath = getBinPath();
// Make sure the parent directory exists.
steps.add(new MkdirStep(binPath.getParent()));
// Generate and return the PEX build step.
steps.add(new PexStep(
pathToPex,
binPath,
PythonUtil.toModuleName(getBuildTarget(), main.toString()),
PythonUtil.getPathMapFromSourcePaths(components.getModules()),
PythonUtil.getPathMapFromSourcePaths(components.getResources())));
// Record the executable package for caching.
buildableContext.recordArtifact(getBinPath());
return steps.build();
}
示例2: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
for (Path dir : dirs) {
steps.add(
CopyStep.forDirectory(
dir,
outputDirectory,
CopyStep.DirectoryMode.DIRECTORY_AND_CONTENTS));
}
for (SourcePath file : files) {
steps.add(CopyStep.forFile(file.resolve(), outputDirectory));
}
// TODO(grp): Support copying variant resources like Xcode.
return steps.build();
}
示例3: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext) {
// .so files are written to the libs/ subdirectory of the output directory.
// All of them should be recorded via the BuildableContext.
Path binDirectory = buildArtifactsDirectory.resolve("libs");
Step nkdBuildStep = new NdkBuildStep(makefileDirectory,
buildArtifactsDirectory,
binDirectory,
flags);
Step mkDirStep = new MakeCleanDirectoryStep(genDirectory);
Step copyStep = CopyStep.forDirectory(
binDirectory,
genDirectory,
CopyStep.DirectoryMode.CONTENTS_ONLY);
buildableContext.recordArtifactsInDirectory(genDirectory);
// Some tools need to inspect .so files whose symbols haven't been stripped, so cache these too.
buildableContext.recordArtifactsInDirectory(buildArtifactsDirectory);
return ImmutableList.of(nkdBuildStep, mkDirStep, copyStep);
}
示例4: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext) {
ImmutableList.Builder<Step> commands = ImmutableList.builder();
// Clear out the old file, if it exists.
commands.add(new RmStep(pathToOutputFile,
/* shouldForceDeletion */ true,
/* shouldRecurse */ false));
// Make sure the directory for the output file exists.
commands.add(new MkdirStep(pathToOutputFile.getParent()));
commands.add(new GenerateManifestStep(
skeletonFile.resolve(),
manifestFiles,
getPathToOutputFile()));
buildableContext.recordArtifact(pathToOutputFile);
return commands.build();
}
示例5: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext) {
MakeCleanDirectoryStep mkdir = new MakeCleanDirectoryStep(output.getParent());
// Generate an .sh file that builds up an environment and invokes the user's script.
// This generated .sh file will be returned by getExecutableCommand().
GenerateShellScriptStep generateShellScript = new GenerateShellScriptStep(
getBuildTarget().getBasePath(),
main.resolve(),
SourcePaths.toPaths(resources),
output);
buildableContext.recordArtifact(output);
return ImmutableList.of(mkdir, generateShellScript);
}
示例6: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
Path pathToOutput = context.getSourcePathResolver().getRelativePath(getSourcePathToOutput());
MkdirStep mkOutputDirStep =
MkdirStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), pathToOutput.getParent()));
JarDirectoryStep mergeOutputsStep =
new JarDirectoryStep(
getProjectFilesystem(),
JarParameters.builder()
.setJarPath(pathToOutput)
.setEntriesToJar(
toOutputPaths(context.getSourcePathResolver(), traversedDeps.packagedDeps))
.setMergeManifests(true)
.build());
return ImmutableList.of(mkOutputDirStep, mergeOutputsStep);
}
示例7: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
buildableContext.recordArtifact(pathToOutput);
// Ask the super class for its own steps that will produce the jar and then move the jar
// to the expected output location.
return ImmutableList.<Step>builder()
.add(
RmStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), pathToOutput)))
.addAll(super.getBuildStepsWithoutRecordingOutput(context))
.add(new MoveStep(getProjectFilesystem(), super.pathToOutFile, pathToOutput))
.build();
}
示例8: getPipelinedBuildStepsForAbiJar
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
public ImmutableList<Step> getPipelinedBuildStepsForAbiJar(
BuildTarget buildTarget,
BuildContext context,
BuildableContext buildableContext,
JavacPipelineState state) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
((JavacToJarStepFactory) configuredCompiler)
.createPipelinedCompileToJarStep(
context,
buildTarget,
state,
getResourcesParameters(),
postprocessClassesCommands,
steps,
buildableContext);
return steps.build();
}
示例9: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
for (Path artifact : args.getAllOutputs()) {
buildableContext.recordArtifact(artifact);
}
return ImmutableList.of(
MkdirStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), args.output.getParent())),
new OcamlMLCompileStep(
getBuildTarget(),
getProjectFilesystem().getRootPath(),
context.getSourcePathResolver(),
args));
}
示例10: getPipelinedBuildStepsForLibraryJar
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
public ImmutableList<Step> getPipelinedBuildStepsForLibraryJar(
BuildContext context, BuildableContext buildableContext, JavacPipelineState state) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
((JavacToJarStepFactory) configuredCompiler)
.createPipelinedCompileToJarStep(
context,
libraryTarget,
state,
getResourcesParameters(),
postprocessClassesCommands,
steps,
buildableContext);
JavaLibraryRules.addAccumulateClassNamesStep(
libraryTarget,
projectFilesystem,
getSourcePathToOutput(libraryTarget),
buildableContext,
context,
steps);
return steps.build();
}
示例11: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
ProjectFilesystem filesystem = getProjectFilesystem();
SourcePathResolver sourcePathResolver = context.getSourcePathResolver();
Path classAbiPath = sourcePathResolver.getAbsolutePath(classAbi);
Path sourceAbiPath = sourcePathResolver.getAbsolutePath(sourceAbi);
buildableContext.recordArtifact(outputPath);
return ImmutableList.of(
MkdirStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), outputPath.getParent())),
DiffAbisStep.of(classAbiPath, sourceAbiPath, verificationMode),
CopyStep.forFile(filesystem, classAbiPath, outputPath));
}
示例12: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
ImmutableList<Step> result =
ImmutableList.of(
MkdirStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(),
getProjectFilesystem(),
outputPath.getParent())),
RmStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), outputPath)),
new CalculateClassAbiStep(
getProjectFilesystem(),
context.getSourcePathResolver().getAbsolutePath(binaryJar),
outputPath,
compatibilityMode));
buildableContext.recordArtifact(outputPath);
return result;
}
示例13: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
String name = getBuildTarget().getShortName();
Path dir = getOutputDir();
LOG.verbose(name);
ImmutableList.Builder<Step> steps = ImmutableList.builder();
steps.addAll(
MakeCleanDirectoryStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), dir)));
steps.add(
new HaddockStep(
getBuildTarget(), getProjectFilesystem().getRootPath(), context, Type.HTML));
steps.add(
new HaddockStep(
getBuildTarget(), getProjectFilesystem().getRootPath(), context, Type.HOOGLE));
buildableContext.recordArtifact(dir);
return steps.build();
}
示例14: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
steps.add(
MkdirStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(),
getProjectFilesystem(),
outputJsonFile.getParent())));
steps.add(
new GenerateCompilationCommandsJson(
context.getSourcePathResolver(),
context.getSourcePathResolver().getRelativePath(getSourcePathToOutput())));
return steps.build();
}
示例15: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //導入依賴的package包/類
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
LOG.debug("Generating build steps to write header map to %s", headerMapPath);
ImmutableMap.Builder<Path, Path> entriesBuilder = ImmutableMap.builder();
for (Map.Entry<Path, SourcePath> entry : getLinks().entrySet()) {
entriesBuilder.put(
entry.getKey(), context.getSourcePathResolver().getAbsolutePath(entry.getValue()));
}
return ImmutableList.<Step>builder()
.add(getVerifyStep())
.add(
MkdirStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(),
getProjectFilesystem(),
headerMapPath.getParent())))
.add(
RmStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), headerMapPath)))
.add(new HeaderMapStep(getProjectFilesystem(), headerMapPath, entriesBuilder.build()))
.build();
}