use of com.google.devtools.build.lib.rules.proto.ProtoSourceFileBlacklist in project bazel by bazelbuild.
the class J2ObjcAspect method proto.
private ConfiguredAspect proto(ConfiguredTarget base, RuleContext ruleContext, AspectParameters parameters) throws InterruptedException {
ProtoSourcesProvider protoSourcesProvider = base.getProvider(ProtoSourcesProvider.class);
ImmutableList<Artifact> protoSources = protoSourcesProvider.getDirectProtoSources();
// Avoid pulling in any generated files from blacklisted protos.
ProtoSourceFileBlacklist protoBlacklist = new ProtoSourceFileBlacklist(ruleContext, ruleContext.getPrerequisiteArtifacts(PROTO_SOURCE_FILE_BLACKLIST_ATTR, Mode.HOST).list());
ImmutableList<Artifact> filteredProtoSources = ImmutableList.copyOf(protoBlacklist.filter(protoSources));
J2ObjcSource j2ObjcSource = protoJ2ObjcSource(ruleContext, filteredProtoSources);
J2ObjcMappingFileProvider directJ2ObjcMappingFileProvider;
if (Iterables.isEmpty(j2ObjcSource.getObjcSrcs())) {
directJ2ObjcMappingFileProvider = new J2ObjcMappingFileProvider.Builder().build();
} else {
directJ2ObjcMappingFileProvider = createJ2ObjcProtoCompileActions(base, ruleContext, filteredProtoSources, j2ObjcSource);
}
return buildAspect(base, ruleContext, parameters, j2ObjcSource, directJ2ObjcMappingFileProvider, PROTO_DEPENDENT_ATTRIBUTES);
}
Aggregations