Constraint proto_library deps and exports on ProtoInfo provider.
This makes the constraint more general, perhaps allows users to create there own version of proto_library.
Because proto_library advertises the ProtoInfo provider, all the old uses will continue to work in Bazel.
@@ -61,7 +61,8 @@ public final class BazelProtoLibraryRule implements RuleDefinition {
<code>proto_library</code> targets.
It may not depend on language-specific libraries.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
- .override(attr("deps", LABEL_LIST).allowedRuleClasses("proto_library").allowedFileTypes())
+ .override(
+ attr("deps", LABEL_LIST).mandatoryProviders(ProtoInfo.PROVIDER.id()).allowedFileTypes())
/* <!-- #BLAZE_RULE(proto_library).ATTRIBUTE(srcs) -->
The list of <code>.proto</code> and <code>.protodevel</code> files that are
processed to create the target. This is usually a non empty list. One usecase
@@ -77,7 +78,10 @@ public final class BazelProtoLibraryRule implements RuleDefinition {
List of proto_library targets that can be referenced via "import public" in the proto
source.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
- .add(attr("exports", LABEL_LIST).allowedRuleClasses("proto_library").allowedFileTypes())
+ .add(
+ attr("exports", LABEL_LIST)
+ .mandatoryProviders(ProtoInfo.PROVIDER.id())
+ .allowedFileTypes())
/* <!-- #BLAZE_RULE(proto_library).ATTRIBUTE(strip_import_prefix) -->
The prefix to strip from the paths of the .proto files in this rule.
