licenses(["notice"])

sh_binary(
    name = "generate-groups",
    srcs = ["generate-groups.sh"],
    data = [
        ":client",
        ":conversion",
        ":deepcopy",
        ":informer",
        ":lister",
        ":openapi",
    ],
    visibility = ["//visibility:public"],
)

sh_binary(
    name = "generate-groups-internal",
    srcs = ["generate-groups-internal.sh"],
    data = [
        ":client",
        ":deepcopy",
        ":defaulter",
        ":informer",
        ":lister",
    ],
    visibility = ["//visibility:public"],
)

genrule(
    name = "deepcopy",
    srcs = ["//vendor/k8s.io/code-generator/cmd/deepcopy-gen"],
    outs = ["deepcopy-gen"],
    cmd = "cp $(SRCS) $@",
)

genrule(
    name = "defaulter",
    srcs = ["//vendor/k8s.io/code-generator/cmd/defaulter-gen"],
    outs = ["defaulter-gen"],
    cmd = "cp $(SRCS) $@",
)

genrule(
    name = "informer",
    srcs = ["//vendor/k8s.io/code-generator/cmd/informer-gen"],
    outs = ["informer-gen"],
    cmd = "cp $(SRCS) $@",
)

genrule(
    name = "client",
    srcs = ["//vendor/k8s.io/code-generator/cmd/client-gen"],
    outs = ["client-gen"],
    cmd = "cp $(SRCS) $@",
)

genrule(
    name = "lister",
    srcs = ["//vendor/k8s.io/code-generator/cmd/lister-gen"],
    outs = ["lister-gen"],
    cmd = "cp $(SRCS) $@",
)

genrule(
    name = "conversion",
    srcs = ["//vendor/k8s.io/code-generator/cmd/conversion-gen"],
    outs = ["conversion-gen"],
    cmd = "cp $(SRCS) $@",
    executable = True,
)

genrule(
    name = "openapi",
    srcs = ["//vendor/k8s.io/kube-openapi/cmd/openapi-gen"],
    outs = ["openapi-gen"],
    cmd = "cp $(SRCS) $@",
    visibility = ["//visibility:public"],
)

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

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