2019-08-23 18:37:16 +00:00
|
|
|
load("@bazel_skylib//:version.bzl", "version")
|
2023-01-20 21:48:10 +00:00
|
|
|
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
2023-08-28 18:39:43 +00:00
|
|
|
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
|
|
|
load("distribution.bzl", "remove_internal_only")
|
2019-08-23 18:37:16 +00:00
|
|
|
|
2020-02-18 18:00:50 +00:00
|
|
|
package(
|
2024-05-01 21:24:18 +00:00
|
|
|
default_applicable_licenses = ["//:license"],
|
2020-02-18 18:00:50 +00:00
|
|
|
default_visibility = ["//visibility:private"],
|
|
|
|
)
|
|
|
|
|
2024-05-02 18:38:05 +00:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2023-01-27 15:02:13 +00:00
|
|
|
remove_internal_only(
|
|
|
|
name = "distro_workspace",
|
|
|
|
src = "//:WORKSPACE",
|
|
|
|
out = "WORKSPACE",
|
|
|
|
)
|
|
|
|
|
|
|
|
remove_internal_only(
|
2022-08-30 18:57:34 +00:00
|
|
|
name = "distro_module_bazel",
|
2023-01-27 15:02:13 +00:00
|
|
|
src = "//:MODULE.bazel",
|
|
|
|
out = "MODULE.bazel",
|
|
|
|
)
|
|
|
|
|
|
|
|
# remove "distribution/" path prefix
|
|
|
|
pkg_files(
|
|
|
|
name = "distro-files-without-prefix",
|
|
|
|
srcs = [
|
|
|
|
"distro_module_bazel",
|
|
|
|
"distro_workspace",
|
|
|
|
],
|
|
|
|
strip_prefix = strip_prefix.from_pkg(),
|
2022-08-30 18:57:34 +00:00
|
|
|
)
|
|
|
|
|
2019-08-23 18:37:16 +00:00
|
|
|
pkg_tar(
|
2023-01-20 21:48:10 +00:00
|
|
|
name = "bazel-skylib",
|
2022-08-30 18:57:34 +00:00
|
|
|
srcs = [
|
2023-01-27 15:02:13 +00:00
|
|
|
"distro-files-without-prefix",
|
2022-08-30 18:57:34 +00:00
|
|
|
"//:distribution",
|
|
|
|
],
|
2023-01-20 21:48:10 +00:00
|
|
|
out = "bazel-skylib-%s.tar.gz" % version,
|
2019-08-23 18:37:16 +00:00
|
|
|
extension = "tar.gz",
|
2022-03-10 12:41:11 +00:00
|
|
|
mode = "0644",
|
2019-08-23 18:37:16 +00:00
|
|
|
# Make it owned by root so it does not have the uid of the CI robot.
|
|
|
|
owner = "0.0",
|
2023-01-20 21:48:10 +00:00
|
|
|
strip_prefix = strip_prefix.from_root(),
|
2019-08-23 18:37:16 +00:00
|
|
|
)
|
|
|
|
|
2023-01-27 15:02:13 +00:00
|
|
|
# @bazel_skylib_gazelle_plugin//:WORKSPACE refers to bazel-skylib in the parent
|
|
|
|
# directory. For distribution, use the minimal WORSKPACE.bzlmod instead.
|
|
|
|
pkg_files(
|
|
|
|
name = "bazel-skylib-gazelle-plugin-distro_workspace",
|
|
|
|
srcs = ["@bazel_skylib_gazelle_plugin//:WORKSPACE.bzlmod"],
|
|
|
|
renames = {"@bazel_skylib_gazelle_plugin//:WORKSPACE.bzlmod": "WORKSPACE"},
|
|
|
|
)
|
|
|
|
|
2023-01-20 21:48:10 +00:00
|
|
|
pkg_files(
|
|
|
|
name = "bazel-skylib-gazelle-plugin-without-external-prefix",
|
|
|
|
srcs = [
|
|
|
|
"@bazel_skylib_gazelle_plugin//:distribution",
|
|
|
|
"@bazel_skylib_gazelle_plugin//bzl:distribution",
|
|
|
|
],
|
|
|
|
strip_prefix = strip_prefix.from_root(),
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_tar(
|
|
|
|
name = "bazel-skylib-gazelle-plugin",
|
|
|
|
srcs = [
|
2023-01-27 15:02:13 +00:00
|
|
|
"bazel-skylib-gazelle-plugin-distro_workspace",
|
|
|
|
"bazel-skylib-gazelle-plugin-without-external-prefix",
|
2023-01-20 21:48:10 +00:00
|
|
|
"//:LICENSE",
|
|
|
|
],
|
|
|
|
out = "bazel-skylib-gazelle-plugin-%s.tar.gz" % version,
|
|
|
|
extension = "tar.gz",
|
|
|
|
mode = "0644",
|
|
|
|
# Make it owned by root so it does not have the uid of the CI robot.
|
|
|
|
owner = "0.0",
|
|
|
|
)
|
|
|
|
|
2023-01-27 15:02:13 +00:00
|
|
|
# Build the artifacts to put on the github release page.
|
2023-01-20 21:48:10 +00:00
|
|
|
filegroup(
|
|
|
|
name = "distribution",
|
|
|
|
srcs = [
|
|
|
|
"bazel-skylib",
|
|
|
|
"bazel-skylib-gazelle-plugin",
|
|
|
|
],
|
2019-08-23 18:37:16 +00:00
|
|
|
)
|