use of com.google.devtools.build.lib.packages.AttributeMap in project bazel by bazelbuild.
the class ResourceDependencies method extractFromAttributes.
private static void extractFromAttributes(Iterable<String> attributeNames, RuleContext ruleContext, NestedSetBuilder<ResourceContainer> builderForTransitive, NestedSetBuilder<ResourceContainer> builderForDirect) {
AttributeMap attributes = ruleContext.attributes();
for (String attr : attributeNames) {
if (!attributes.has(attr, BuildType.LABEL_LIST) && !attributes.has(attr, BuildType.LABEL)) {
continue;
}
for (AndroidResourcesProvider resources : ruleContext.getPrerequisites(attr, Mode.TARGET, AndroidResourcesProvider.class)) {
builderForTransitive.addTransitive(resources.getTransitiveAndroidResources());
builderForDirect.addTransitive(resources.getDirectAndroidResources());
}
}
}
Aggregations