blob: ccb0c7255efb6ab40c5576e51053930a23a46fae [file] [log] [blame]
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain")
load("@rules_rust_prost//:defs.bzl", "rust_prost_toolchain")
# Configure protoc to have the right arguments for generating Python stubs.
# NB: the protobuf team intends to remove --python_out and instead use a protoc plugin for Python stub emit.
proto_lang_toolchain(
name = "protoc_py_toolchain",
command_line = "--python_out=%s",
progress_message = "Generating Python proto_library %{label}",
runtime = "@pypi//protobuf",
toolchain_type = "@rules_python//python/proto:toolchain_type",
)
# Same as above, but for Java
proto_lang_toolchain(
name = "protoc_java_toolchain",
command_line = "--java_out=%s",
progress_message = "Generating Java proto_library %{label}",
runtime = "@protobuf-java//jar",
toolchain_type = "@rules_java//java/proto:toolchain_type",
)
rust_prost_toolchain(
name = "prost_toolchain_impl",
prost_plugin = "@crates//:protoc-gen-prost__protoc-gen-prost",
prost_runtime = "//tools:prost_runtime",
prost_types = "@crates//:prost-types",
tonic_plugin = "@crates//:protoc-gen-tonic__protoc-gen-tonic",
tonic_runtime = "//tools:tonic_runtime",
)
toolchain(
name = "prost_toolchain",
toolchain = "prost_toolchain_impl",
toolchain_type = "@rules_rust_prost//:toolchain_type",
)