@@ -14,7 +14,10 @@ load("//bazel/common:proto_lang_toolchain_info.bzl", "ProtoLangToolchainInfo")
1414load ("//bazel/private:toolchain_helpers.bzl" , "toolchains" )
1515
1616def _rule_impl (ctx ):
17- provided_proto_sources = depset (transitive = [bp [ProtoInfo ].transitive_sources for bp in ctx .attr .blacklisted_protos ]).to_list ()
17+ if ctx .attr .blacklisted_protos and ctx .attr .denylisted_protos :
18+ fail ("Only one of 'denylisted_protos' and 'blacklisted_protos' can be set (prefer 'denylisted_protos')." )
19+ denylisted_protos = ctx .attr .denylisted_protos or ctx .attr .blacklisted_protos
20+ provided_proto_sources = depset (transitive = [bp [ProtoInfo ].transitive_sources for bp in denylisted_protos ]).to_list ()
1821
1922 flag = ctx .attr .command_line
2023 if flag .find ("$(PLUGIN_OUT)" ) > - 1 :
@@ -121,13 +124,20 @@ passed to the proto-compiler:
121124A language-specific library that the generated code is compiled against.
122125The exact behavior is LANG_proto_library-specific.
123126Java, for example, should compile against the runtime.""" ),
124- "blacklisted_protos " : attr .label_list (
127+ "denylisted_protos " : attr .label_list (
125128 providers = [ProtoInfo ],
126129 doc = """
127130No code will be generated for files in the <code>srcs</code> attribute of
128- <code>blacklisted_protos </code>.
131+ <code>denylisted_protos </code>.
129132This is used for .proto files that are already linked into proto runtimes, such as
130133<code>any.proto</code>.""" ,
134+ ),
135+ # TODO: Remove this once it is safe to do so in OSS.
136+ "blacklisted_protos" : attr .label_list (
137+ providers = [ProtoInfo ],
138+ doc = """
139+ Deprecated. Alias for <code>denylisted_protos</code>. Will be removed in a future release.
140+ """ ,
131141 ),
132142 # TODO: add doc
133143 "allowlist_different_package" : attr .label (
0 commit comments