Protocol Buffer Rules
proto_lang_toolchain
proto_lang_toolchain(name, blacklisted_protos, command_line, compatible_with, deprecation, distribs, features, licenses, plugin, restricted_to, runtime, tags, testonly, visibility)
Specifies how a LANG_proto_library rule (e.g., java_proto_library) should invoke the
proto-compiler.
Some LANG_proto_library rules allow specifying which toolchain to use using command-line flags;
consult their documentation.
Normally you should not write those kind of rules unless you want to tune your Java compiler.
There's no compiler. The proto-compiler is taken from the proto_library rule we attach to. It is
passed as a command-line flag to Bazel.
Several features require a proto-compiler to be invoked on the proto_library rule itself.
It's beneficial to enforce the compiler that LANG_proto_library uses is the same as the one
proto_library does.
Examples
A simple example would be:
proto_lang_toolchain(
    name = "javalite_toolchain",
    command_line = "--$(PLUGIN_OUT)=shared,immutable:$(OUT)",
    plugin = ":javalite_plugin",
    runtime = ":protobuf_lite",
)
  Arguments
| Attributes | |
|---|---|
| name | 
 A unique name for this rule. | 
| blacklisted_protos | 
 srcsattribute ofblacklisted_protos.
        This is used for .proto files that are already linked into proto runtimes, such asany.proto. | 
| command_line | 
 
 | 
| plugin | 
 --plugin=protoc-gen-PLUGIN= | 
| runtime | 
 | 
proto_library
proto_library(name, deps, srcs, data, compatible_with, deprecation, distribs, features, licenses, proto_source_root, restricted_to, tags, testonly, visibility)
Use proto_library to define libraries of protocol buffers
   which may be used from multiple languages. A proto_library may be listed
   in the deps clause of supported rules, such as java_proto_library.
When compiled on the command-line, a proto_library creates a file named
   foo-descriptor-set.proto.bin, which is the descriptor set for the
   messages the rule srcs. The file is a serialized FileDescriptorSet, which is
   described in
   
   https://developers.google.com/protocol-buffers/docs/techniques#self-description.
It only contains information about the .proto files directly mentioned by a
proto_library rule; the collection of transitive descriptor sets is available through
the proto.transitive_descriptor_sets Skylark provider.
See documentation in ProtoSourcesProvider.java.
Arguments
| Attributes | |
|---|---|
| name | 
 A unique name for this rule. | 
| deps | 
 proto_libraryrules that the target depends upon.
        Aproto_librarymay only depend on otherproto_librarytargets.
        It may not depend on language-specific libraries. | 
| srcs | 
 .protoand.protodevelfiles that are
        processed to create the target. This is usually a non empty list. One usecase
        wheresrcscan be empty is an alias-library. This is a
        proto_library rule having one or more other proto_library indeps.
        This pattern can be used to e.g. export a public api under a persistent name. | 
| proto_source_root | 
 |