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

go_library(
    name = "go_default_library",
    srcs = [
        "dependencies.go",
        "notes.go",
        "notes_map.go",
        "toc.go",
    ],
    importpath = "k8s.io/release/pkg/notes",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/git:go_default_library",
        "//pkg/github:go_default_library",
        "//pkg/notes/options:go_default_library",
        "@com_github_google_go_github_v29//github:go_default_library",
        "@com_github_nozzle_throttler//:go_default_library",
        "@com_github_pkg_errors//:go_default_library",
        "@com_github_saschagrunert_go_modiff//pkg/modiff:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@in_gopkg_yaml_v2//:go_default_library",
    ],
)

go_test(
    name = "go_default_test",
    srcs = [
        "dependencies_test.go",
        "notes_gatherer_test.go",
        "notes_test.go",
        "toc_test.go",
    ],
    embed = [":go_default_library"],
    deps = [
        "//pkg/git:go_default_library",
        "//pkg/github:go_default_library",
        "//pkg/github/githubfakes:go_default_library",
        "//pkg/notes/notesfakes:go_default_library",
        "@com_github_google_go_github_v29//github:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@com_github_stretchr_testify//require:go_default_library",
    ],
)

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

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//pkg/notes/document:all-srcs",
        "//pkg/notes/internal:all-srcs",
        "//pkg/notes/notesfakes:all-srcs",
        "//pkg/notes/options:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
