diff options
author | Mike Lewis <lewis@squareup.com> | 2018-04-13 10:29:11 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-13 10:30:26 -0700 |
commit | 28daf76e8f86370b9276a3e248d4c2eddf275d44 (patch) | |
tree | 439c1394fdb77b7cafd32454d12fb0812e1669e5 /src/main/java/com/google/devtools/build/lib/rules/proto | |
parent | d60bb5c4131ea7b389b8cef8faaa0983d191e583 (diff) |
Adding toolchain support for j2objc protos
Ran into an issue where it wasn't possible to add protos to blacklist for j2objc toolchain and was getting duplicate symbols for the descriptor protos.
This change should make it consistent with the other proto rules which use a toolchain. Was able to remove bespoke and uncustomizable proto blacklist for j2objc.
Closes #4064.
PiperOrigin-RevId: 192787964
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/proto')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java | 16 |
1 files changed, 16 insertions, 0 deletions
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 de26c36b95..c730a7b874 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 @@ -101,6 +101,17 @@ public class ProtoConfiguration extends Fragment { public Label protoToolchainForJava; @Option( + name = "proto_toolchain_for_j2objc", + defaultValue = "@bazel_tools//tools/j2objc:j2objc_proto_toolchain", + category = "flags", + converter = BuildConfiguration.EmptyToNullLabelConverter.class, + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.LOADING_AND_ANALYSIS}, + help = "Label of proto_lang_toolchain() which describes how to compile j2objc protos" + ) + public Label protoToolchainForJ2objc; + + @Option( name = "proto_toolchain_for_cc", defaultValue = "@com_google_protobuf//:cc_toolchain", converter = BuildConfiguration.EmptyToNullLabelConverter.class, @@ -151,6 +162,7 @@ public class ProtoConfiguration extends Fragment { host.experimentalProtoExtraActions = experimentalProtoExtraActions; host.protoCompiler = protoCompiler; host.protoToolchainForJava = protoToolchainForJava; + host.protoToolchainForJ2objc = protoToolchainForJ2objc; host.protoToolchainForJavaLite = protoToolchainForJavaLite; host.protoToolchainForCc = protoToolchainForCc; host.strictProtoDeps = strictProtoDeps; @@ -215,6 +227,10 @@ public class ProtoConfiguration extends Fragment { return options.protoToolchainForJava; } + public Label protoToolchainForJ2objc() { + return options.protoToolchainForJ2objc; + } + public Label protoToolchainForJavaLite() { return options.protoToolchainForJavaLite; } |