Skip to content

Commit 8d34217

Browse files
committed
split out the deleted packgaes to a separate file
1 parent a497e69 commit 8d34217

File tree

3 files changed

+53
-9
lines changed

3 files changed

+53
-9
lines changed

.bazelrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
# Trick bazel into treating BUILD files under examples/* as being regular files
33
# This lets us glob() up all the files inside the examples to make them inputs to tests
44
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
5-
# To update these lines, execute
6-
# `./tools/update_deleted_packages.sh`
7-
common --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/py_proto_library/foo_external,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered,tests/modules/another_module,tests/modules/other,tests/modules/other/nspkg_delta,tests/modules/other/nspkg_gamma,tests/modules/other/nspkg_single,tests/modules/other/simple_v1,tests/modules/other/simple_v2,tests/modules/other/with_external_data
5+
# To update the file, execute
6+
import .bazelrc.deleted_packages
87

98
test --test_output=errors
109

.bazelrc.deleted_packages

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Generated via './tools/update_deleted_packages.sh'
2+
common --deleted_packages=examples/build_file_generation
3+
common --deleted_packages=examples/build_file_generation/random_number_generator
4+
common --deleted_packages=examples/bzlmod
5+
common --deleted_packages=examples/bzlmod/entry_points
6+
common --deleted_packages=examples/bzlmod/entry_points/tests
7+
common --deleted_packages=examples/bzlmod/libs/my_lib
8+
common --deleted_packages=examples/bzlmod/other_module
9+
common --deleted_packages=examples/bzlmod/other_module/other_module/pkg
10+
common --deleted_packages=examples/bzlmod/patches
11+
common --deleted_packages=examples/bzlmod/py_proto_library
12+
common --deleted_packages=examples/bzlmod/py_proto_library/example.com/another_proto
13+
common --deleted_packages=examples/bzlmod/py_proto_library/example.com/proto
14+
common --deleted_packages=examples/bzlmod/py_proto_library/foo_external
15+
common --deleted_packages=examples/bzlmod/runfiles
16+
common --deleted_packages=examples/bzlmod/tests
17+
common --deleted_packages=examples/bzlmod/tests/other_module
18+
common --deleted_packages=examples/bzlmod/whl_mods
19+
common --deleted_packages=examples/multi_python_versions/libs/my_lib
20+
common --deleted_packages=examples/multi_python_versions/requirements
21+
common --deleted_packages=examples/multi_python_versions/tests
22+
common --deleted_packages=examples/pip_parse
23+
common --deleted_packages=examples/pip_parse_vendored
24+
common --deleted_packages=examples/pip_repository_annotations
25+
common --deleted_packages=examples/py_proto_library
26+
common --deleted_packages=examples/py_proto_library/example.com/another_proto
27+
common --deleted_packages=examples/py_proto_library/example.com/proto
28+
common --deleted_packages=gazelle/examples/bzlmod_build_file_generation
29+
common --deleted_packages=gazelle/examples/bzlmod_build_file_generation/other_module/other_module/pkg
30+
common --deleted_packages=gazelle/examples/bzlmod_build_file_generation/runfiles
31+
common --deleted_packages=tests/integration/compile_pip_requirements
32+
common --deleted_packages=tests/integration/compile_pip_requirements_test_from_external_repo
33+
common --deleted_packages=tests/integration/custom_commands
34+
common --deleted_packages=tests/integration/local_toolchains
35+
common --deleted_packages=tests/integration/pip_parse
36+
common --deleted_packages=tests/integration/pip_parse/empty
37+
common --deleted_packages=tests/integration/py_cc_toolchain_registered
38+
common --deleted_packages=tests/modules/another_module
39+
common --deleted_packages=tests/modules/other
40+
common --deleted_packages=tests/modules/other/nspkg_delta
41+
common --deleted_packages=tests/modules/other/nspkg_gamma
42+
common --deleted_packages=tests/modules/other/nspkg_single
43+
common --deleted_packages=tests/modules/other/simple_v1
44+
common --deleted_packages=tests/modules/other/simple_v2
45+
common --deleted_packages=tests/modules/other/with_external_data

tools/update_deleted_packages.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ DIR="$(dirname $0)/.."
2929
cd $DIR
3030

3131
# The sed -i.bak pattern is compatible between macos and linux
32-
sed -i.bak "/^[^#].*--deleted_packages/s#=.*#=$(\
33-
find examples/*/* tests/*/* \( -name WORKSPACE -or -name MODULE.bazel \) |
32+
{
33+
echo "# Generated via './tools/update_deleted_packages.sh'"
34+
find examples/*/* tests/*/* gazelle/examples/*/* \( -name WORKSPACE -or -name MODULE.bazel \) |
3435
xargs -n 1 dirname |
35-
xargs -n 1 -I{} find {} \( -name BUILD -or -name BUILD.bazel \) |
36+
xargs -I{} find {} \( -name BUILD -or -name BUILD.bazel \) |
3637
xargs -n 1 dirname |
3738
sort -u |
38-
grep -v 'gazelle/docs' |
39-
paste -sd, -\
40-
)#" $DIR/.bazelrc && rm .bazelrc.bak
39+
sed 's/^/common --deleted_packages=/g'
40+
} > "$DIR"/.bazelrc.deleted_packages

0 commit comments

Comments
 (0)