当前位置: 首页>>代码示例>>Java>>正文


Java BuildableContext.recordArtifact方法代码示例

本文整理汇总了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();
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:25,代码来源:PythonBinary.java

示例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();
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:24,代码来源:AndroidManifest.java

示例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);
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:19,代码来源:ShBinary.java

示例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();
}
 
开发者ID:facebook,项目名称:buck,代码行数:27,代码来源:CGoGenSource.java

示例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();
}
 
开发者ID:facebook,项目名称:buck,代码行数:22,代码来源:MergeAndroidResourceSources.java

示例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));
}
 
开发者ID:facebook,项目名称:buck,代码行数:18,代码来源:JsLibrary.java

示例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()));
}
 
开发者ID:facebook,项目名称:buck,代码行数:18,代码来源:CxxStrip.java

示例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();
}
 
开发者ID:facebook,项目名称:buck,代码行数:18,代码来源:GenerateCodeForMergedLibraryMap.java

示例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));
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:12,代码来源:CxxLink.java

示例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));
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:10,代码来源:CxxCompile.java

示例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);
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:14,代码来源:JavaLibraryRules.java

示例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();
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:36,代码来源:JavaSourceJar.java

示例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();
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:31,代码来源:GwtModule.java

示例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();
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:38,代码来源:PackageStringAssets.java

示例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);
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:42,代码来源:ProGuardObfuscateStep.java


注:本文中的com.facebook.buck.rules.BuildableContext.recordArtifact方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。