From b4804807fc2c184cc36df9e69e472942c01941b8 Mon Sep 17 00:00:00 2001 From: Ivo List Date: Fri, 4 Mar 2022 17:36:19 +0100 Subject: [PATCH] Make protocOpts() public. (#14952) * Make protocOpts() public. RELNOTES: Make protocOpts() publicly accessible. PiperOrigin-RevId: 430726712 * Cleanup * Add import. * Add the right import. Co-authored-by: Googler --- src/main/java/com/google/devtools/build/lib/rules/proto/BUILD | 1 + .../devtools/build/lib/rules/proto/ProtoConfiguration.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/BUILD b/src/main/java/com/google/devtools/build/lib/rules/proto/BUILD index 1067e484595629..6c45232c43407d 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/proto/BUILD +++ b/src/main/java/com/google/devtools/build/lib/rules/proto/BUILD @@ -51,6 +51,7 @@ java_library( "//src/main/java/com/google/devtools/build/lib/vfs", "//src/main/java/com/google/devtools/build/lib/vfs:pathfragment", "//src/main/java/com/google/devtools/common/options", + "//src/main/java/net/starlark/java/annot", "//src/main/java/net/starlark/java/eval", "//third_party:auto_value", "//third_party:guava", diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java index e8d2b90cbeed78..722b6ab41b1692 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java @@ -30,6 +30,7 @@ import com.google.devtools.common.options.OptionEffectTag; import com.google.devtools.common.options.OptionMetadataTag; import java.util.List; +import net.starlark.java.annot.StarlarkMethod; /** Configuration for Protocol Buffer Libraries. */ @Immutable @@ -201,6 +202,7 @@ public ProtoConfiguration(BuildOptions buildOptions) { this.options = options; } + @StarlarkMethod(name = "experimental_protoc_opts", structField = true, documented = false) public ImmutableList protocOpts() { return protocOpts; }