Skip to content

Commit 46bd268

Browse files
authored
Strip internal test fake repository for MODULE.bazel in distribution. (#976)
Fixes #953
1 parent daa4964 commit 46bd268

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ license(
2727
license_text = "LICENSE",
2828
)
2929

30-
exports_files(
31-
["WORKSPACE"],
32-
)
30+
exports_files([
31+
"MODULE.bazel",
32+
"WORKSPACE",
33+
])
3334

3435
exports_files(
3536
glob([
@@ -44,7 +45,6 @@ filegroup(
4445
]) + [
4546
"BUILD",
4647
"LICENSE",
47-
"MODULE.bazel",
4848
],
4949
visibility = ["//distro:__pkg__"],
5050
)

MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ register_toolchains(
2525
dev_dependency = True,
2626
)
2727

28+
### INTERNAL ONLY - lines after this are not included in the release packaging.
29+
2830
# Find the system Git if one is available.
2931
find_git = use_extension("//toolchains/git:git_configure.bzl", "experimental_find_system_git_extension", dev_dependency = True)
3032
use_repo(find_git, "rules_pkg_git")

distro/BUILD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ alias(
3232
pkg_tar(
3333
name = "rules_pkg-%s" % version,
3434
srcs = [
35+
":small_module",
3536
":small_workspace",
3637
"//:standard_package",
3738
"//pkg:standard_package",
@@ -52,6 +53,13 @@ pkg_tar(
5253
strip_prefix = ".",
5354
)
5455

56+
genrule(
57+
name = "small_module",
58+
srcs = ["//:MODULE.bazel"],
59+
outs = ["MODULE.bazel"],
60+
cmd = "sed -e '/### INTERNAL ONLY/,$$d' $(location //:MODULE.bazel) >$@",
61+
)
62+
5563
genrule(
5664
name = "small_workspace",
5765
srcs = ["//:WORKSPACE"],

0 commit comments

Comments
 (0)