...

Text file src/github.com/bazelbuild/rules_go/go/tools/go_bin_runner/BUILD.bazel

Documentation: github.com/bazelbuild/rules_go/go/tools/go_bin_runner

     1# gazelle:exclude
     2
     3load("//go:def.bzl", "go_binary", "go_library")
     4load("//go/private/rules:go_bin_for_host.bzl", "go_bin_for_host")
     5
     6go_bin_for_host(
     7    name = "go_bin_for_host",
     8    visibility = ["//visibility:private"],
     9)
    10
    11go_library(
    12    name = "go_bin_runner_lib",
    13    srcs = [
    14        "main.go",
    15        "process.go",
    16    ],
    17    importpath = "github.com/bazelbuild/rules_go/go/tools/go_bin_runner",
    18    visibility = ["//visibility:private"],
    19    deps = [
    20        "//go/runfiles",
    21    ],
    22)
    23
    24go_binary(
    25    name = "go_bin_runner",
    26    # Make this binary usable as a drop-in replacement for the actual go binary with external tools.
    27    out = select({
    28        "@platforms//os:windows": "bin/go.exe",
    29        "//conditions:default": "bin/go",
    30    }),
    31    data = [":go_bin_for_host"],
    32    embed = [":go_bin_runner_lib"],
    33    visibility = ["//go:__pkg__"],
    34    x_defs = {
    35        "GoBinRlocationPath": "$(rlocationpath :go_bin_for_host)",
    36    },
    37)
    38
    39filegroup(
    40    name = "all_files",
    41    testonly = True,
    42    srcs = glob(["**"]),
    43    visibility = ["//visibility:public"],
    44)

View as plain text