本文整理匯總了Java中com.facebook.buck.model.BuildTarget.getFullyQualifiedName方法的典型用法代碼示例。如果您正苦於以下問題:Java BuildTarget.getFullyQualifiedName方法的具體用法?Java BuildTarget.getFullyQualifiedName怎麽用?Java BuildTarget.getFullyQualifiedName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.buck.model.BuildTarget
的用法示例。
在下文中一共展示了BuildTarget.getFullyQualifiedName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toBuildRulesFor
import com.facebook.buck.model.BuildTarget; //導入方法依賴的package包/類
public static ImmutableSortedSet<BuildRule> toBuildRulesFor(
BuildTarget invokingBuildTarget,
BuildRuleResolver ruleResolver,
Iterable<BuildTarget> buildTargets,
boolean allowNonExistentRule) {
ImmutableSortedSet.Builder<BuildRule> buildRules = ImmutableSortedSet.naturalOrder();
for (BuildTarget target : buildTargets) {
BuildRule buildRule = ruleResolver.get(target);
if (buildRule != null) {
buildRules.add(buildRule);
} else if (!allowNonExistentRule) {
throw new HumanReadableException("No rule for %s found when processing %s",
target, invokingBuildTarget.getFullyQualifiedName());
}
}
return buildRules.build();
}
示例2: getBuildTargetForAlias
import com.facebook.buck.model.BuildTarget; //導入方法依賴的package包/類
@Nullable
public String getBuildTargetForAlias(String alias) {
Preconditions.checkNotNull(alias);
BuildTarget buildTarget = aliasToBuildTargetMap.get(alias);
if (buildTarget != null) {
return buildTarget.getFullyQualifiedName();
} else {
return null;
}
}
示例3: parse
import com.facebook.buck.model.BuildTarget; //導入方法依賴的package包/類
/**
* 1. //src/com/facebook/buck/cli:cli will be convert to a single build target
* 2. //src/com/facebook/buck/cli: will match all in the same directory.
* 3. //src/com/facebook/buck/cli/... will match all in or under that directory.
* For case 2 and 3, parseContext is expected to be {@link ParseContext#forVisibilityArgument()}.
*/
public BuildTargetPattern parse(
String buildTargetPattern,
ParseContext parseContext) throws NoSuchBuildTargetException {
Preconditions.checkNotNull(buildTargetPattern);
if (buildTargetPattern.equals(VISIBILITY_PUBLIC)) {
if (parseContext.getType() != ParseContext.Type.VISIBILITY) {
throw new BuildTargetParseException(
String.format("%s not supported in the parse context", VISIBILITY_PUBLIC));
} else {
return BuildTargetPattern.MATCH_ALL;
}
}
Preconditions.checkArgument(buildTargetPattern.startsWith(BUILD_RULE_PREFIX),
"buildTargetPattern must start with //");
Preconditions.checkNotNull(parseContext);
if (buildTargetPattern.endsWith(WILDCARD_BUILD_RULE_SUFFIX)) {
if (parseContext.getType() != ParseContext.Type.VISIBILITY) {
throw new BuildTargetParseException(
String.format("%s cannot end with ...", buildTargetPattern));
} else {
if (buildTargetPattern.contains(BUILD_RULE_SEPARATOR)) {
throw new BuildTargetParseException(String.format(
"%s cannot contain colon", buildTargetPattern));
}
String basePathWithSlash = buildTargetPattern.substring(
BUILD_RULE_PREFIX.length(),
buildTargetPattern.length() - WILDCARD_BUILD_RULE_SUFFIX.length());
return new SubdirectoryBuildTargetPattern(basePathWithSlash);
}
} else {
BuildTarget target = buildTargetParser.parse(buildTargetPattern, parseContext);
if (target.getShortName().isEmpty()) {
return new ImmediateDirectoryBuildTargetPattern(target.getBasePathWithSlash());
} else {
return new SingletonBuildTargetPattern(target.getFullyQualifiedName());
}
}
}