load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//build:version.bzl", "version_x_defs")
load("//build:go_binary.bzl", "go_binary")

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "github.com/jetstack/cert-manager/cmd/cainjector",
    visibility = ["//visibility:private"],
    deps = [
        "//cmd/cainjector/app:go_default_library",
        "//pkg/logs:go_default_library",
        "//pkg/util:go_default_library",
        "//pkg/util/cmd:go_default_library",
        "@io_k8s_sigs_controller_runtime//:go_default_library",
    ],
)

go_binary(
    name = "cainjector",
    embed = [":go_default_library"],
    pure = "on",
    visibility = ["//visibility:public"],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//cmd/cainjector/app:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
