revert
diff --git a/bazel/common/proto_info.bzl b/bazel/common/proto_info.bzl new file mode 100644 index 0000000..887e1ce --- /dev/null +++ b/bazel/common/proto_info.bzl
@@ -0,0 +1,7 @@ +"""ProtoInfo""" + +load("@proto_bazel_features//:features.bzl", "bazel_features") +load("//bazel/private:proto_info.bzl", _ProtoInfo = "ProtoInfo") # buildifier: disable=bzl-visibility + +# This resolves to Starlark ProtoInfo in Bazel 8 or with --incompatible_enable_autoload flag +ProtoInfo = getattr(bazel_features.globals, "ProtoInfo", None) or _ProtoInfo
diff --git a/bazel/common/proto_lang_toolchain_info.bzl b/bazel/common/proto_lang_toolchain_info.bzl new file mode 100644 index 0000000..bc08346 --- /dev/null +++ b/bazel/common/proto_lang_toolchain_info.bzl
@@ -0,0 +1,26 @@ +"""ProtoLangToolchainInfo""" + +load("//bazel/private:native.bzl", "native_proto_common") # buildifier: disable=bzl-visibility + +# Use Starlark implementation only if native_proto_common.ProtoLangToolchainInfo doesn't exist +ProtoLangToolchainInfo = getattr(native_proto_common, "ProtoLangToolchainInfo", provider( + doc = """Specifies how to generate language-specific code from .proto files. + Used by LANG_proto_library rules.""", + fields = dict( + out_replacement_format_flag = """(str) Format string used when passing output to the plugin + used by proto compiler.""", + output_files = """("single","multiple","legacy") Format out_replacement_format_flag with + a path to single file or a directory in case of multiple files.""", + plugin_format_flag = "(str) Format string used when passing plugin to proto compiler.", + plugin = "(FilesToRunProvider) Proto compiler plugin.", + runtime = "(Target) Runtime.", + provided_proto_sources = "(list[File]) Proto sources provided by the toolchain.", + proto_compiler = "(FilesToRunProvider) Proto compiler.", + protoc_opts = "(list[str]) Options to pass to proto compiler.", + progress_message = "(str) Progress message to set on the proto compiler action.", + mnemonic = "(str) Mnemonic to set on the proto compiler action.", + allowlist_different_package = """(Target) Allowlist to create lang_proto_library in a + different package than proto_library""", + toolchain_type = """(Label) Toolchain type that was used to obtain this info""", + ), +))