github.com/stackb/rules_proto@v0.0.0-20240221195024-5428336c51f1/toolchain/toolchain.bzl (about)

     1  "toolchain.bzl provides the protoc toolchain rule"
     2  
     3  def _protoc_impl(ctx):
     4      return [platform_common.ToolchainInfo(
     5          protoc_target = ctx.attr.tool,
     6          protoc_executable = ctx.executable.tool,
     7      )]
     8  
     9  protoc = rule(
    10      implementation = _protoc_impl,
    11      attrs = {
    12          "tool": attr.label(
    13              doc = "The protocol compiler tool",
    14              allow_single_file = True,
    15              executable = True,
    16              cfg = "exec",
    17          ),
    18      },
    19      provides = [platform_common.ToolchainInfo],
    20  )