Skip to content

Commit

Permalink
Make protocOpts() public.
Browse files Browse the repository at this point in the history
RELNOTES:
Make protocOpts() publicly accessible.
PiperOrigin-RevId: 430726712
  • Loading branch information
Googler authored and copybara-github committed Feb 24, 2022
1 parent c753421 commit 0e73219
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,8 @@ public ProtoConfiguration(BuildOptions buildOptions) {
this.options = options;
}

@StarlarkMethod(name = "protoc_opts", useStarlarkThread = true, documented = false)
public ImmutableList<String> protocOptsForStarlark(StarlarkThread thread) throws EvalException {
ProtoCommon.checkPrivateStarlarkificationAllowlist(thread);
@StarlarkMethod(name = "experimental_protoc_opts", structField = true, documented = false)
public ImmutableList<String> protocOptsForStarlark() throws EvalException {
return protocOpts();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/starlark/builtins_bzl/common/proto/proto_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _create_proto_compile_action(
resource_set = None):
"""Creates proto compile action for compiling *.proto files to language specific sources.
It uses proto configuration fragment to access protoc_opts and strict_proto_deps flags.
It uses proto configuration fragment to access experimental_protoc_opts and strict_proto_deps flags.
Args:
ctx: The rule context, used to create the action and to obtain label.
Expand Down Expand Up @@ -68,7 +68,7 @@ def _create_proto_compile_action(
else:
args.add(arg)

args.add_all(ctx.fragments.proto.protoc_opts())
args.add_all(ctx.fragments.proto.experimental_protoc_opts)

# Include maps
# For each import, include both the import as well as the import relativized against its
Expand Down

0 comments on commit 0e73219

Please sign in to comment.