Add external repos required by tests and a "fetch all" filegroup.
This is used to prefetch all external repositories required by our integration tests. A follow-up CL will then instruct the "inner Bazel" running inside the tests to use the repositories from the "outer Bazel"'s "external" folder, instead of downloading / extracting them itself. This results in a massive reduction of I/O and network traffic when running integration tests and will also allow us to disable network access in the sandbox by default for our tests, resulting in better hermeticity and reduces the risk of accidental additions of remote dependencies.
The cost is that we have to take a bit more care when maintaining our dependencies, especially for the "built-in" workspace files like "coverage.WORKSPACE" or "jdk.WORKSPACE", but IMHO this is worth it.
RELNOTES: None.
PiperOrigin-RevId: 291905728
diff --git a/src/BUILD b/src/BUILD
index 03e3551..af2999a 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -736,3 +736,61 @@
"//third_party/ijar:__pkg__",
],
)
+
+filegroup(
+ name = "test_repos",
+ srcs = [
+ "@android_tools_for_testing//:WORKSPACE",
+ "@bazel_toolchains//:WORKSPACE",
+ "@com_google_protobuf//:WORKSPACE",
+ "@openjdk10_darwin_archive//:WORKSPACE",
+ "@openjdk10_linux_archive//:WORKSPACE",
+ "@openjdk10_windows_archive//:WORKSPACE",
+ "@openjdk11_darwin_archive//:WORKSPACE",
+ "@openjdk11_linux_archive//:WORKSPACE",
+ "@openjdk11_windows_archive//:WORKSPACE",
+ "@openjdk12_darwin_archive//:WORKSPACE",
+ "@openjdk12_linux_archive//:WORKSPACE",
+ "@openjdk12_windows_archive//:WORKSPACE",
+ "@openjdk9_darwin_archive//:WORKSPACE",
+ "@openjdk9_linux_archive//:WORKSPACE",
+ "@openjdk9_windows_archive//:WORKSPACE",
+ "@openjdk_linux_aarch64_minimal//file",
+ "@openjdk_linux_minimal//file",
+ "@openjdk_macos_minimal//file",
+ "@openjdk_win_minimal//file",
+ "@remote_coverage_tools_for_testing//:WORKSPACE",
+ "@remote_java_tools_darwin_for_testing//:WORKSPACE",
+ "@remote_java_tools_javac10_test_darwin//:WORKSPACE",
+ "@remote_java_tools_javac10_test_linux//:WORKSPACE",
+ "@remote_java_tools_javac10_test_windows//:WORKSPACE",
+ "@remote_java_tools_javac11_test_darwin//:WORKSPACE",
+ "@remote_java_tools_javac11_test_linux//:WORKSPACE",
+ "@remote_java_tools_javac11_test_windows//:WORKSPACE",
+ "@remote_java_tools_javac12_test_darwin//:WORKSPACE",
+ "@remote_java_tools_javac12_test_linux//:WORKSPACE",
+ "@remote_java_tools_javac12_test_windows//:WORKSPACE",
+ "@remote_java_tools_javac9_test_darwin//:WORKSPACE",
+ "@remote_java_tools_javac9_test_linux//:WORKSPACE",
+ "@remote_java_tools_javac9_test_windows//:WORKSPACE",
+ "@remote_java_tools_linux_for_testing//:WORKSPACE",
+ "@remote_java_tools_windows_for_testing//:WORKSPACE",
+ "@remotejdk10_linux_aarch64_for_testing//:WORKSPACE",
+ "@remotejdk10_linux_for_testing//:WORKSPACE",
+ "@remotejdk10_macos_for_testing//:WORKSPACE",
+ "@remotejdk10_win_for_testing//:WORKSPACE",
+ "@remotejdk11_linux_aarch64_for_testing//:WORKSPACE",
+ "@remotejdk11_linux_for_testing//:WORKSPACE",
+ "@remotejdk11_macos_for_testing//:WORKSPACE",
+ "@remotejdk11_win_for_testing//:WORKSPACE",
+ "@remotejdk_linux_aarch64_for_testing//:WORKSPACE",
+ "@remotejdk_linux_for_testing//:WORKSPACE",
+ "@remotejdk_macos_for_testing//:WORKSPACE",
+ "@remotejdk_win_for_testing//:WORKSPACE",
+ "@rules_cc//:WORKSPACE",
+ "@rules_java//:WORKSPACE",
+ "@rules_pkg//:WORKSPACE",
+ "@rules_proto//:WORKSPACE",
+ "@rules_python//:WORKSPACE",
+ ],
+)