本文整理汇总了Java中com.facebook.buck.rules.BuildableContext.recordArtifact方法的典型用法代码示例。如果您正苦于以下问题:Java BuildableContext.recordArtifact方法的具体用法?Java BuildableContext.recordArtifact怎么用?Java BuildableContext.recordArtifact使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.buck.rules.BuildableContext
的用法示例。
在下文中一共展示了BuildableContext.recordArtifact方法的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> 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();
}
示例3: 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);
}
示例4: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
steps.addAll(
MakeCleanDirectoryStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), genDir)));
steps.add(
new CGoCompileStep(
getBuildTarget(),
getProjectFilesystem().getRootPath(),
cgo.getEnvironment(context.getSourcePathResolver()),
cgo.getCommandPrefix(context.getSourcePathResolver()),
cgoCompilerFlags,
cgoSrcs
.stream()
.map(context.getSourcePathResolver()::getAbsolutePath)
.collect(ImmutableList.toImmutableList()),
platform,
genDir));
buildableContext.recordArtifact(genDir);
return steps.build();
}
示例5: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
steps.addAll(
MakeCleanDirectoryStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), destinationDirectory)));
steps.add(
MergeAndroidResourceSourcesStep.builder()
.setResPaths(
originalDirectories
.stream()
.map(context.getSourcePathResolver()::getAbsolutePath)
.collect(ImmutableList.toImmutableList()))
.setOutFolderPath(getProjectFilesystem().resolve(destinationDirectory))
.setTmpFolderPath(getProjectFilesystem().resolve(tempDirectory))
.build());
buildableContext.recordArtifact(destinationDirectory);
return steps.build();
}
示例6: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
private static ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext,
BuildTargetSourcePath output,
ProjectFilesystem filesystem,
WorkerTool worker,
BiFunction<SourcePathResolver, Path, String> jobArgs) {
SourcePathResolver resolver = context.getSourcePathResolver();
Path outputPath = resolver.getAbsolutePath(output);
buildableContext.recordArtifact(resolver.getRelativePath(output));
return ImmutableList.of(
RmStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), filesystem, outputPath)),
JsUtil.workerShellStep(
worker, jobArgs.apply(resolver, outputPath), output.getTarget(), resolver, filesystem));
}
示例7: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
buildableContext.recordArtifact(output);
return ImmutableList.of(
CopyStep.forFile(
getProjectFilesystem(),
context.getSourcePathResolver().getAbsolutePath(unstrippedBinary),
output),
new StripSymbolsStep(
getBuildTarget(),
output,
strip.getCommandPrefix(context.getSourcePathResolver()),
strip.getEnvironment(context.getSourcePathResolver()),
stripStyle.getStripToolArgs(),
getProjectFilesystem()));
}
示例8: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
Path output = context.getSourcePathResolver().getRelativePath(getSourcePathToOutput());
buildableContext.recordArtifact(output);
buildableContext.recordArtifact(getMappingPath());
buildableContext.recordArtifact(getTargetsPath());
return new ImmutableList.Builder<Step>()
.addAll(
MakeCleanDirectoryStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), output.getParent())))
.add(new WriteMapDataStep())
.add(new WriteTargetsFileStep())
.add(new RunCodeGenStep(getBuildTarget(), context.getSourcePathResolver()))
.build();
}
示例9: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
buildableContext.recordArtifact(output);
return ImmutableList.of(
new MkdirStep(output.getParent()),
new CxxLinkStep(
linker,
output,
args));
}
示例10: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext) {
buildableContext.recordArtifact(output);
return ImmutableList.of(
new MkdirStep(output.getParent()),
new CxxCompileStep(compiler, flags, output, input.resolve(), includes, systemIncludes));
}
示例11: addAccumulateClassNamesStep
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
static void addAccumulateClassNamesStep(JavaLibrary javaLibrary,
BuildableContext buildableContext,
ImmutableList.Builder<Step> steps) {
Preconditions.checkNotNull(javaLibrary);
Path pathToClassHashes = JavaLibraryRules.getPathToClassHashes(
javaLibrary.getBuildTarget());
steps.add(new MkdirStep(pathToClassHashes.getParent()));
steps.add(new AccumulateClassNamesStep(
Optional.fromNullable(javaLibrary.getPathToOutputFile()),
pathToClassHashes));
buildableContext.recordArtifact(pathToClassHashes);
}
示例12: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
JavaPackageFinder packageFinder = context.getJavaPackageFinder();
ImmutableList.Builder<Step> steps = ImmutableList.builder();
steps.add(new MkdirStep(output.getParent()));
steps.add(new RmStep(output, /* force deletion */ true));
steps.add(new MakeCleanDirectoryStep(temp));
Set<Path> seenPackages = Sets.newHashSet();
// We only want to consider raw source files, since the java package finder doesn't have the
// smarts to read the "package" line from a source file.
for (Path source : SourcePaths.filterInputsToCompareToOutput(sources)) {
String packageFolder = packageFinder.findJavaPackageFolderForPath(source.toString());
Path packageDir = temp.resolve(packageFolder);
if (seenPackages.add(packageDir)) {
steps.add(new MkdirStep(packageDir));
}
steps.add(CopyStep.forFile(source, packageDir.resolve(source.getFileName())));
}
steps.add(new ZipStep(
output,
ImmutableSet.<Path>of(),
/* junk paths */ false,
DEFAULT_COMPRESSION_LEVEL,
temp));
buildableContext.recordArtifact(output);
return steps.build();
}
示例13: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
Path workingDirectory = outputFile.getParent();
steps.add(new MakeCleanDirectoryStep(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(
getBuildTarget(),
filesForGwtModule,
tempJarFolder,
context.getJavaPackageFinder()));
steps.add(new JarDirectoryStep(
outputFile,
/* entriesToJar */ ImmutableSet.of(tempJarFolder),
/* mainClass */ null,
/* manifestFile */ null));
buildableContext.recordArtifact(outputFile);
return steps.build();
}
示例14: getBuildSteps
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context,
BuildableContext buildableContext) {
if (filteredResourcesProvider.getResDirectories().isEmpty()) {
// There is no zip file, but we still need to provide a consistent hash to
// ComputeExopackageDepsAbi in this case.
buildableContext.addMetadata(
STRING_ASSETS_ZIP_HASH,
Hashing.sha1().hashInt(0).toString());
return ImmutableList.of();
}
ImmutableList.Builder<Step> steps = ImmutableList.builder();
// We need to generate a zip file with the following dir structure:
// /assets/strings/*.fbstr
Path pathToBaseDir = getPathToStringAssetsDir();
Path pathToDirContainingAssetsDir = pathToBaseDir.resolve("string_assets");
steps.add(new MakeCleanDirectoryStep(pathToDirContainingAssetsDir));
Path pathToStrings = pathToDirContainingAssetsDir.resolve("assets").resolve("strings");
Path pathToStringAssetsZip = getPathToStringAssetsZip();
steps.add(new MakeCleanDirectoryStep(pathToStrings));
steps.add(new CompileStringsStep(
filteredResourcesProvider.getNonEnglishStringFiles(),
uberRDotJava.getPathToRDotTxtDir(),
pathToStrings));
steps.add(new ZipStep(
pathToStringAssetsZip,
ImmutableSet.<Path>of(),
false,
ZipStep.MAX_COMPRESSION_LEVEL,
pathToDirContainingAssetsDir));
steps.add(
new RecordFileSha1Step(pathToStringAssetsZip, STRING_ASSETS_ZIP_HASH, buildableContext));
buildableContext.recordArtifact(pathToStringAssetsZip);
return steps.build();
}
示例15: create
import com.facebook.buck.rules.BuildableContext; //导入方法依赖的package包/类
/**
* Create steps that write out ProGuard's command line arguments to a text file and then run
* ProGuard using those arguments. We write the arguments to a file to avoid blowing out
* exec()'s ARG_MAX limit.
*
* @param steps Where to append the generated steps.
*/
public static void create(
Optional<Path> proguardJarOverride,
Path generatedProGuardConfig,
Set<Path> customProguardConfigs,
SdkProguardType sdkProguardConfig,
Optional<Integer> optimizationPasses,
Map<Path, Path> inputAndOutputEntries,
Set<Path> additionalLibraryJarsForProguard,
Path proguardDirectory,
BuildableContext buildableContext,
ImmutableList.Builder<Step> steps) {
Path pathToProGuardCommandLineArgsFile = proguardDirectory.resolve("command-line.txt");
CommandLineHelperStep commandLineHelperStep = new CommandLineHelperStep(
generatedProGuardConfig,
customProguardConfigs,
sdkProguardConfig,
optimizationPasses,
inputAndOutputEntries,
additionalLibraryJarsForProguard,
proguardDirectory,
pathToProGuardCommandLineArgsFile);
ProGuardObfuscateStep proGuardStep = new ProGuardObfuscateStep(
inputAndOutputEntries,
pathToProGuardCommandLineArgsFile,
proguardJarOverride);
buildableContext.recordArtifact(commandLineHelperStep.getConfigurationTxt());
buildableContext.recordArtifact(commandLineHelperStep.getMappingTxt());
steps.add(commandLineHelperStep, proGuardStep);
}