• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""ProtoLangToolchainInfo"""
2
3load("//bazel/private:native.bzl", "native_proto_common")  # buildifier: disable=bzl-visibility
4
5# Use Starlark implementation only if native_proto_common.ProtoLangToolchainInfo doesn't exist
6ProtoLangToolchainInfo = getattr(native_proto_common, "ProtoLangToolchainInfo", provider(
7    doc = """Specifies how to generate language-specific code from .proto files.
8            Used by LANG_proto_library rules.""",
9    fields = dict(
10        out_replacement_format_flag = """(str) Format string used when passing output to the plugin
11          used by proto compiler.""",
12        output_files = """("single","multiple","legacy") Format out_replacement_format_flag with
13          a path to single file or a directory in case of multiple files.""",
14        plugin_format_flag = "(str) Format string used when passing plugin to proto compiler.",
15        plugin = "(FilesToRunProvider) Proto compiler plugin.",
16        runtime = "(Target) Runtime.",
17        provided_proto_sources = "(list[File]) Proto sources provided by the toolchain.",
18        proto_compiler = "(FilesToRunProvider) Proto compiler.",
19        protoc_opts = "(list[str]) Options to pass to proto compiler.",
20        progress_message = "(str) Progress message to set on the proto compiler action.",
21        mnemonic = "(str) Mnemonic to set on the proto compiler action.",
22        allowlist_different_package = """(Target) Allowlist to create lang_proto_library in a
23          different package than proto_library""",
24        toolchain_type = """(Label) Toolchain type that was used to obtain this info""",
25    ),
26))
27