Skip to content

Commit 88815f6

Browse files
committed
Update test_version/WORKSPACE.template for 7.3.2
Updated the repo information for `bazel_skylib` and `rules_proto` directly, and copied the `rules_proto` initialization calls from `WORKSPACE`. Implemented the `append_additional_dev_dependencies()` scheme to avoid duplicating the setup for `protobuf` and its dependencies (`rules_pkg`, `rules_java_external`, `com_google_absl`, `zlib`).
1 parent 4a82062 commit 88815f6

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

WORKSPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ remote_jdk21_repositories()
200200

201201
remote_jdk21_toolchains()
202202

203+
# //test_version:WORKSPACE.template dependencies
204+
203205
http_archive(
204206
name = "com_google_protobuf",
205207
sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db",

test_version.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ compilation_should_fail() {
2626
fi
2727
}
2828

29+
append_additional_dev_dependencies() {
30+
local source="$1"
31+
local dest="$2"
32+
local marker='# //test_version:WORKSPACE.template dependencies'
33+
local emit_deps=""
34+
35+
while IFS="" read line; do
36+
if [[ -n "$emit_deps" ]]; then
37+
echo "$line" >>"$dest"
38+
elif [[ "$line" == "$marker" ]]; then
39+
emit_deps='true'
40+
fi
41+
done <"$source"
42+
}
43+
2944
run_in_test_repo() {
3045
local SCALA_VERSION=${SCALA_VERSION:-$SCALA_VERSION_DEFAULT}
3146

@@ -44,6 +59,7 @@ run_in_test_repo() {
4459
sed \
4560
-e "s%\${twitter_scrooge_repositories}%$TWITTER_SCROOGE_REPOSITORIES%" \
4661
WORKSPACE.template >> $NEW_TEST_DIR/WORKSPACE
62+
append_additional_dev_dependencies '../WORKSPACE' "$NEW_TEST_DIR/WORKSPACE"
4763
cp ../.bazelrc $NEW_TEST_DIR/.bazelrc
4864

4965
cd $NEW_TEST_DIR

test_version/WORKSPACE.template

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,32 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

55
http_archive(
66
name = "bazel_skylib",
7-
sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7",
7+
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
88
urls = [
9-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz",
10-
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz",
9+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.4.1.tar.gz",
10+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
1111
],
1212
)
1313

1414
http_archive(
1515
name = "rules_proto",
16-
sha256 = "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da",
17-
strip_prefix = "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488",
16+
sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295",
17+
strip_prefix = "rules_proto-6.0.2",
1818
urls = [
19-
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
20-
"https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
19+
"https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz",
2120
],
2221
)
2322

24-
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
23+
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
2524

2625
rules_proto_dependencies()
2726

27+
load("@rules_proto//proto:setup.bzl", "rules_proto_setup")
28+
29+
rules_proto_setup()
30+
31+
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
32+
2833
rules_proto_toolchains()
2934

3035
local_repository(

0 commit comments

Comments
 (0)