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

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

go_binary(
    name = "ctl",
    out = "kubectl-cert_manager",
    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/ctl/cmd:all-srcs",
        "//cmd/ctl/pkg/convert:all-srcs",
        "//cmd/ctl/pkg/create:all-srcs",
        "//cmd/ctl/pkg/inspect:all-srcs",
        "//cmd/ctl/pkg/renew:all-srcs",
        "//cmd/ctl/pkg/status:all-srcs",
        "//cmd/ctl/pkg/util:all-srcs",
        "//cmd/ctl/pkg/version:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
