當前位置: 首頁>>代碼示例>>Java>>正文


Java BuildTarget.getBasePath方法代碼示例

本文整理匯總了Java中com.facebook.buck.model.BuildTarget.getBasePath方法的典型用法代碼示例。如果您正苦於以下問題:Java BuildTarget.getBasePath方法的具體用法?Java BuildTarget.getBasePath怎麽用?Java BuildTarget.getBasePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.facebook.buck.model.BuildTarget的用法示例。


在下文中一共展示了BuildTarget.getBasePath方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getBasePathToAliasMap

import com.facebook.buck.model.BuildTarget; //導入方法依賴的package包/類
/**
 * Create a map of {@link BuildTarget} base paths to aliases. Note that there may be more than
 * one alias to a base path, so the first one listed in the .buckconfig will be chosen.
 */
public ImmutableMap<Path, String> getBasePathToAliasMap() {
  ImmutableMap<String, String> aliases = sectionsToEntries.get(ALIAS_SECTION_HEADER);
  if (aliases == null) {
    return ImmutableMap.of();
  }

  // Build up the Map with an ordinary HashMap because we need to be able to check whether the Map
  // already contains the key before inserting.
  Map<Path, String> basePathToAlias = Maps.newHashMap();
  for (Map.Entry<String, BuildTarget> entry : aliasToBuildTargetMap.entrySet()) {
    String alias = entry.getKey();
    BuildTarget buildTarget = entry.getValue();

    Path basePath = buildTarget.getBasePath();
    if (!basePathToAlias.containsKey(basePath)) {
      basePathToAlias.put(basePath, alias);
    }
  }
  return ImmutableMap.copyOf(basePathToAlias);
}
 
開發者ID:saleehk,項目名稱:buck-cutom,代碼行數:25,代碼來源:BuckConfig.java

示例2: generateProjects

import com.facebook.buck.model.BuildTarget; //導入方法依賴的package包/類
public ImmutableSet<Path> generateProjects() throws IOException {
  ImmutableSet.Builder<Path> generatedProjectPathsBuilder = ImmutableSet.builder();
  ImmutableMap.Builder<BuildTarget, ProjectGenerator> projectGeneratorsBuilder =
      ImmutableMap.builder();
  for (BuildTarget target : projectConfigTargets) {
    BuildRule rule = partialGraph.getActionGraph().findBuildRuleByTarget(target);
    XcodeProjectConfig buildable =
        (XcodeProjectConfig) Preconditions.checkNotNull(rule);

    ImmutableSet.Builder<BuildTarget> initialTargetsBuilder = ImmutableSet.builder();
    for (BuildRule memberRule : buildable.getRules()) {
      initialTargetsBuilder.add(memberRule.getBuildTarget());
    }
    ProjectGenerator generator = new ProjectGenerator(
        partialGraph.getActionGraph().getNodes(),
        initialTargetsBuilder.build(),
        projectFilesystem,
        executionContext,
        target.getBasePath(),
        buildable.getProjectName(),
        projectGeneratorOptions);
    generator.createXcodeProjects();
    projectGeneratorsBuilder.put(target, generator);
    generatedProjectPathsBuilder.add(generator.getProjectPath());
  }
  projectGenerators = projectGeneratorsBuilder.build();
  return generatedProjectPathsBuilder.build();
}
 
開發者ID:saleehk,項目名稱:buck-cutom,代碼行數:29,代碼來源:SeparatedProjectsGenerator.java

示例3: createRelativePath

import com.facebook.buck.model.BuildTarget; //導入方法依賴的package包/類
/**
 * @param pathRelativeToProjectRoot if {@code null}, then this method returns {@code null}
 */
@Nullable
private static String createRelativePath(@Nullable Path pathRelativeToProjectRoot,
    BuildTarget target) {
  if (pathRelativeToProjectRoot == null) {
    return null;
  }
  Path directoryPath = target.getBasePath();
  Preconditions.checkArgument(pathRelativeToProjectRoot.startsWith(directoryPath));
  // TODO(simons): Hey, this is crazy, here's a toString(), fix it maybe?
  // Path.relativize doesn't cut the mustard, since we need a leading slash. Not sure if that's
  // always the case, though.
  return pathRelativeToProjectRoot.toString().substring(directoryPath.toString().length());
}
 
開發者ID:saleehk,項目名稱:buck-cutom,代碼行數:17,代碼來源:Project.java

示例4: getHeaderMapPathForTarget

import com.facebook.buck.model.BuildTarget; //導入方法依賴的package包/類
private Path getHeaderMapPathForTarget(BuildTarget target, String suffix) {
  Path targetPath = target.getBasePath();
  String fileName = getProductName(target) + suffix;
  return BuckConstant.BUCK_OUTPUT_PATH.resolve(targetPath).resolve(fileName);
}
 
開發者ID:saleehk,項目名稱:buck-cutom,代碼行數:6,代碼來源:ProjectGenerator.java


注:本文中的com.facebook.buck.model.BuildTarget.getBasePath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。