本文整理匯總了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);
}
示例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();
}
示例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());
}
示例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);
}