package(default_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"],
)

genrule(
    name = "boilerplate.bzl.timestamped.txt",
    srcs = [":boilerplate.bzl.txt"],
    outs = ["boilerplate.bzl.timestamped.txt.out"],
    cmd = " ".join([
        "sed",
        "s/YEAR/$$(grep '^STABLE_LAST_COMMIT_YEAR' bazel-out/stable-status.txt | awk '{print $$2}')/",
        "$(location :boilerplate.bzl.txt)",
        "> $@",
    ]),
    stamp = 1,
    visibility = ["//visibility:public"],
)
