blob: 25bf180db4bb5ea042f3d7f356fa74bf5fb95468 [file] [log] [blame]
Kristina Chodorow93fbc3e2016-04-27 17:03:28 +00001workspace(name = "io_bazel")
philwo75edd782019-01-29 05:02:44 -08002
Benjamin Peterson66c22f42022-11-18 07:02:30 -08003load("//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
cushon095f1e22022-02-08 10:54:53 -08004load("//:distdir.bzl", "dist_http_archive", "dist_http_file", "distdir_tar")
Tony Aiuto3b2d3102021-01-07 03:40:14 -08005load("//:distdir_deps.bzl", "DIST_DEPS")
philwo17506af2020-01-28 04:20:39 -08006
7# These can be used as values for the patch_cmds and patch_cmds_win attributes
8# of http_archive, in order to export the WORKSPACE file from the BUILD or
9# BUILD.bazel file. This is useful for cases like //src:test_repos, where we
10# have to be able to trigger a fetch of a repo by depending on it, but we don't
11# actually want to build anything (so we can't depend on a target inside that
12# repo).
13EXPORT_WORKSPACE_IN_BUILD_FILE = [
14 "test -f BUILD && chmod u+w BUILD || true",
15 "echo >> BUILD",
16 "echo 'exports_files([\"WORKSPACE\"], visibility = [\"//visibility:public\"])' >> BUILD",
17]
18
19EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE = [
20 "test -f BUILD.bazel && chmod u+w BUILD.bazel || true",
21 "echo >> BUILD.bazel",
22 "echo 'exports_files([\"WORKSPACE\"], visibility = [\"//visibility:public\"])' >> BUILD.bazel",
23]
24
25EXPORT_WORKSPACE_IN_BUILD_FILE_WIN = [
26 "Add-Content -Path BUILD -Value \"`nexports_files([`\"WORKSPACE`\"], visibility = [`\"//visibility:public`\"])`n\" -Force",
27]
28
29EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN = [
30 "Add-Content -Path BUILD.bazel -Value \"`nexports_files([`\"WORKSPACE`\"], visibility = [`\"//visibility:public`\"])`n\" -Force",
31]
Kristina Chodorow93fbc3e2016-04-27 17:03:28 +000032
David Chenb78bbd52016-03-16 13:17:57 +000033# Protobuf expects an //external:python_headers label which would contain the
34# Python headers if fast Python protos is enabled. Since we are not using fast
35# Python protos, bind python_headers to a dummy target.
36bind(
37 name = "python_headers",
38 actual = "//:dummy",
39)
40
Alpha Lama1a79cb2016-05-15 19:13:52 +000041# Protobuf code generation for GRPC requires three external labels:
42# //external:grpc-java_plugin
43# //external:grpc-jar
44# //external:guava
45bind(
46 name = "grpc-java-plugin",
Vasilios Pantazopoulos5179d032022-04-08 07:55:27 -070047 actual = "//third_party/grpc-java:grpc-java-plugin",
Alpha Lama1a79cb2016-05-15 19:13:52 +000048)
49
50bind(
51 name = "grpc-jar",
Vasilios Pantazopoulos5179d032022-04-08 07:55:27 -070052 actual = "//third_party/grpc-java:grpc-jar",
Alpha Lama1a79cb2016-05-15 19:13:52 +000053)
54
55bind(
56 name = "guava",
57 actual = "//third_party:guava",
58)
59
Tony Aiuto881fc802022-05-25 06:30:17 -070060# We must control the version of rules_license we use, so we load ours before
61# any other repo can bring it in through their deps.
62dist_http_archive(
63 name = "rules_license",
64)
65
Damien Martin-Guillerez0baff0f2017-08-22 17:40:37 +020066# For src/test/shell/bazel:test_srcs
67load("//src/test/shell/bazel:list_source_repository.bzl", "list_source_repository")
cushonb6646232018-09-07 01:44:10 -070068
Damien Martin-Guillerez0baff0f2017-08-22 17:40:37 +020069list_source_repository(name = "local_bazel_source_list")
70
Adam Michael9b7330f2017-03-23 18:40:51 +000071# To run the Android integration tests in //src/test/shell/bazel/android:all or
72# build the Android sample app in //examples/android/java/bazel:hello_world
73#
74# 1. Install an Android SDK and NDK from https://developer.android.com
75# 2. Set the $ANDROID_HOME and $ANDROID_NDK_HOME environment variables
76# 3. Uncomment the two lines below
77#
78# android_sdk_repository(name = "androidsdk")
79# android_ndk_repository(name = "androidndk")
Cal Peyser2152bc12016-04-22 17:08:59 +000080
Adam Michael8a136d82016-11-16 23:04:46 +000081# In order to run //src/test/shell/bazel:maven_skylark_test, follow the
82# instructions above for the Android integration tests and uncomment the
83# following lines:
84# load("//tools/build_defs/repo:maven_rules.bzl", "maven_dependency_plugin")
85# maven_dependency_plugin()
86
gregceca48e9a2020-04-14 08:54:38 -070087# This allows rules written in Starlark to locate apple build tools.
philwo915fa8f2017-05-09 12:17:12 -040088bind(
89 name = "xcrunwrapper",
90 actual = "@bazel_tools//tools/objc:xcrunwrapper",
91)
Carmi Grushkobfaff292016-08-17 18:37:55 +000092
Tony Aiutoe973aef2021-01-11 00:32:51 -080093dist_http_archive(
Carmi Grushko0fd73d62017-02-17 06:49:40 +000094 name = "com_google_protobuf",
Yannic Bonenberger5e571d22020-02-13 07:29:58 -080095 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
96 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
Carmi Grushko0fd73d62017-02-17 06:49:40 +000097)
98
brandjoncb4ba072019-08-01 12:41:43 -070099# This is a mock version of bazelbuild/rules_python that contains only
100# @rules_python//python:defs.bzl. It is used by protobuf.
101# TODO(#9029): We could potentially replace this with the real @rules_python.
102new_local_repository(
103 name = "rules_python",
brandjoncb4ba072019-08-01 12:41:43 -0700104 build_file = "//third_party/rules_python:BUILD",
laurentlbaf265672019-10-22 10:06:21 -0700105 path = "./third_party/rules_python",
brandjoncb4ba072019-08-01 12:41:43 -0700106 workspace_file = "//third_party/rules_python:rules_python.WORKSPACE",
107)
108
John Cater2f838922018-11-12 08:19:03 -0800109local_repository(
Jakob Buchgraber166f28c2017-05-30 16:41:18 +0200110 name = "googleapis",
cushonb6646232018-09-07 01:44:10 -0700111 path = "./third_party/googleapis/",
Jakob Buchgraber166f28c2017-05-30 16:41:18 +0200112)
113
John Cater2f838922018-11-12 08:19:03 -0800114local_repository(
Ola Rozenfeld930119a2018-08-10 11:04:44 -0700115 name = "remoteapis",
cushonb6646232018-09-07 01:44:10 -0700116 path = "./third_party/remoteapis/",
Ola Rozenfeld930119a2018-08-10 11:04:44 -0700117)
118
mennyf431b0c2021-01-13 09:18:29 -0800119dist_http_archive(
kmbbfd89d62018-04-11 14:26:56 -0700120 name = "desugar_jdk_libs",
kmbbfd89d62018-04-11 14:26:56 -0700121)
122
Klaus Aehlig3c9cd822018-05-24 03:35:42 -0700123distdir_tar(
124 name = "additional_distfiles",
Yannic Bonenbergerff449692019-07-25 05:55:49 -0700125 # Keep in sync with the archives fetched as part of building bazel.
cparsons871cd6f2018-08-16 09:10:38 -0700126 archives = [
Googler18236ac2022-08-11 15:50:30 -0700127 "android_tools_pkg-0.27.0.tar.gz",
tedxae247142022-04-21 16:53:51 -0700128 # for android_gmaven_r8
129 "r8-3.3.28.jar",
cparsons871cd6f2018-08-16 09:10:38 -0700130 ],
cushonb6646232018-09-07 01:44:10 -0700131 dirname = "derived/distdir",
Tony Aiutoe973aef2021-01-11 00:32:51 -0800132 dist_deps = {dep: attrs for dep, attrs in DIST_DEPS.items() if "additional_distfiles" in attrs["used_in"]},
Klaus Aehlig3c9cd822018-05-24 03:35:42 -0700133 sha256 = {
Googler18236ac2022-08-11 15:50:30 -0700134 "android_tools_pkg-0.27.0.tar.gz": "1afa4b7e13c82523c8b69e87f8d598c891ec7e2baa41d9e24e08becd723edb4d",
tedxae247142022-04-21 16:53:51 -0700135 "r8-3.3.28.jar": "8626ca32fb47aba7fddd2c897615e2e8ffcdb4d4b213572a2aefb3f838f01972",
cushonb6646232018-09-07 01:44:10 -0700136 },
137 urls = {
Googler18236ac2022-08-11 15:50:30 -0700138 "android_tools_pkg-0.27.0.tar.gz": [
139 "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.27.0.tar.gz",
Jingwen Chen186929e2019-04-02 10:38:30 -0700140 ],
tedxae247142022-04-21 16:53:51 -0700141 "r8-3.3.28.jar": [
142 "https://maven.google.com/com/android/tools/r8/3.3.28/r8-3.3.28.jar",
143 ],
cushonb6646232018-09-07 01:44:10 -0700144 },
Klaus Aehlig3c9cd822018-05-24 03:35:42 -0700145)
146
Philipp Wollermann95048272017-03-17 15:11:58 +0000147# OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK.
cushon095f1e22022-02-08 10:54:53 -0800148dist_http_file(
Tobias Werth218e8f62018-12-13 04:44:35 -0800149 name = "openjdk_linux_vanilla",
philwo75edd782019-01-29 05:02:44 -0800150 downloaded_file_path = "zulu-linux-vanilla.tar.gz",
Tobias Werth218e8f62018-12-13 04:44:35 -0800151)
152
cushon095f1e22022-02-08 10:54:53 -0800153dist_http_file(
philwo9f7fe692019-06-27 06:53:12 -0700154 name = "openjdk_linux_aarch64_vanilla",
155 downloaded_file_path = "zulu-linux-aarch64-vanilla.tar.gz",
philwo9f7fe692019-06-27 06:53:12 -0700156)
157
cushon095f1e22022-02-08 10:54:53 -0800158dist_http_file(
Jason Furmanek04e073e2020-05-28 05:48:09 -0700159 name = "openjdk_linux_ppc64le_vanilla",
Ivo List4c6c9992020-09-23 09:25:05 -0700160 downloaded_file_path = "adoptopenjdk-ppc64le-vanilla.tar.gz",
Jason Furmanek04e073e2020-05-28 05:48:09 -0700161)
162
cushon095f1e22022-02-08 10:54:53 -0800163dist_http_file(
Ruixin Baoe14a6f22020-08-21 06:17:24 -0700164 name = "openjdk_linux_s390x_vanilla",
Ivo List4c6c9992020-09-23 09:25:05 -0700165 downloaded_file_path = "adoptopenjdk-s390x-vanilla.tar.gz",
Ruixin Baoe14a6f22020-08-21 06:17:24 -0700166)
167
cushon095f1e22022-02-08 10:54:53 -0800168dist_http_file(
Thi Doanb39a51c2020-12-07 11:27:56 -0800169 name = "openjdk_macos_x86_64_vanilla",
philwo75edd782019-01-29 05:02:44 -0800170 downloaded_file_path = "zulu-macos-vanilla.tar.gz",
Tobias Werth218e8f62018-12-13 04:44:35 -0800171)
172
cushon095f1e22022-02-08 10:54:53 -0800173dist_http_file(
Yun Peng8c7e11a2021-01-27 03:23:12 -0800174 name = "openjdk_macos_aarch64_vanilla",
175 downloaded_file_path = "zulu-macos-aarch64-vanilla.tar.gz",
Yun Peng8c7e11a2021-01-27 03:23:12 -0800176)
177
cushon095f1e22022-02-08 10:54:53 -0800178dist_http_file(
Tobias Werth218e8f62018-12-13 04:44:35 -0800179 name = "openjdk_win_vanilla",
philwo75edd782019-01-29 05:02:44 -0800180 downloaded_file_path = "zulu-win-vanilla.zip",
Tobias Werth218e8f62018-12-13 04:44:35 -0800181)
182
cushon095f1e22022-02-08 10:54:53 -0800183dist_http_file(
Niyas Sait0ba4caa2022-02-02 10:29:06 -0800184 name = "openjdk_win_arm64_vanilla",
185 downloaded_file_path = "zulu-win-arm64.zip",
Niyas Sait0ba4caa2022-02-02 10:29:06 -0800186)
187
Tony Aiutoe973aef2021-01-11 00:32:51 -0800188dist_http_archive(
Chi Wang26b94ff2021-09-28 23:42:26 -0700189 name = "bazelci_rules",
philwo17506af2020-01-28 04:20:39 -0800190 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
191 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
Googler5f36bf82017-07-12 20:43:08 +0200192)
ccalvarin1cbe62a2017-08-14 21:09:07 +0200193
Chi Wang26b94ff2021-09-28 23:42:26 -0700194load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")
Jakob Buchgraber60df9052019-07-11 06:08:00 -0700195
Chi Wang26b94ff2021-09-28 23:42:26 -0700196rbe_preconfig(
Chi Wang26b94ff2021-09-28 23:42:26 -0700197 name = "rbe_ubuntu1804_java11",
198 toolchain = "ubuntu1804-bazel-java11",
199)
Googlerde0612a2019-03-07 06:06:55 -0800200
ccalvarin8e9f4a82018-03-23 08:19:37 -0700201http_archive(
202 name = "com_google_googletest",
Googlerae532982022-08-11 08:20:13 -0700203 sha256 = "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2",
204 strip_prefix = "googletest-release-1.12.1",
ccalvarin8e9f4a82018-03-23 08:19:37 -0700205 urls = [
Googlerae532982022-08-11 08:20:13 -0700206 "https://mirror.bazel.build/github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz",
207 "https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz",
ccalvarin8e9f4a82018-03-23 08:19:37 -0700208 ],
ccalvarin8e9f4a82018-03-23 08:19:37 -0700209)
210
Tony Aiuto2b7ec5c2021-01-11 07:50:26 -0800211dist_http_archive(
cparsons871cd6f2018-08-16 09:10:38 -0700212 name = "bazel_skylib",
Yannic Bonenberger5e571d22020-02-13 07:29:58 -0800213 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
214 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
cparsonsa5be6612018-08-27 13:21:21 -0700215)
Klaus Aehligacafe5a2018-10-24 03:16:42 -0700216
Alessandro Patti6da80862021-11-11 22:49:37 -0800217dist_http_archive(
218 name = "zstd-jni",
Liam Miller-Cushonc81e1752022-01-13 17:52:18 -0800219 build_file = "//third_party:zstd-jni/zstd-jni.BUILD",
Alessandro Patti6da80862021-11-11 22:49:37 -0800220 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
221 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
Son Luong Ngoc50b9a632022-10-14 06:14:26 -0700222 strip_prefix = "zstd-jni-1.5.2-3",
Alessandro Patti6da80862021-11-11 22:49:37 -0800223)
224
ajurkowski433dc602021-03-12 10:22:39 -0800225http_archive(
226 name = "org_snakeyaml",
ajurkowski433dc602021-03-12 10:22:39 -0800227 build_file_content = """
228java_library(
229 name = "snakeyaml",
ajurkowski433dc602021-03-12 10:22:39 -0800230 srcs = glob(["src/main/**/*.java"]),
fweikert69895ba2022-07-13 04:56:04 -0700231 visibility = [
Googler98f35112022-07-13 07:00:41 -0700232 "@io_bazel//src/main/java/com/google/devtools/build/docgen/release:__pkg__",
fweikert69895ba2022-07-13 04:56:04 -0700233 "@com_google_testparameterinjector//:__pkg__",
234 ],
ajurkowski433dc602021-03-12 10:22:39 -0800235)
236""",
cushonc1d1df02021-04-07 11:07:00 -0700237 sha256 = "fd0e0cc6c5974fc8f08be3a15fb4a59954c7dd958b5b68186a803de6420b6e40",
238 strip_prefix = "asomov-snakeyaml-b28f0b4d87c6",
ajurkowski239a8e72021-03-23 10:22:49 -0700239 urls = ["https://mirror.bazel.build/bitbucket.org/asomov/snakeyaml/get/snakeyaml-1.28.tar.gz"],
ajurkowski433dc602021-03-12 10:22:39 -0800240)
241
ajurkowski433dc602021-03-12 10:22:39 -0800242http_archive(
243 name = "com_google_testparameterinjector",
ajurkowski433dc602021-03-12 10:22:39 -0800244 build_file_content = """
245java_library(
246 name = "testparameterinjector",
247 testonly = True,
248 srcs = glob(["src/main/**/*.java"]),
249 deps = [
250 "@org_snakeyaml//:snakeyaml",
251 "@//third_party:auto_value",
252 "@//third_party:guava",
253 "@//third_party:junit4",
254 "@//third_party/protobuf:protobuf_java",
255 ],
ajurkowskia3353d22021-03-15 12:38:48 -0700256 visibility = ["//visibility:public"],
ajurkowski433dc602021-03-12 10:22:39 -0800257)
258""",
cushonc1d1df02021-04-07 11:07:00 -0700259 sha256 = "562a0e87eb413a7dcad29ebc8d578f6f97503473943585b051c1398a58189b06",
260 strip_prefix = "TestParameterInjector-1.0",
ajurkowski433dc602021-03-12 10:22:39 -0800261 urls = [
262 "https://mirror.bazel.build/github.com/google/TestParameterInjector/archive/v1.0.tar.gz",
263 "https://github.com/google/TestParameterInjector/archive/v1.0.tar.gz",
264 ],
265)
266
Tony Aiuto6a3d5f12021-01-12 13:38:32 -0800267# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
Tony Aiuto3b2d3102021-01-07 03:40:14 -0800268dist_http_archive(
oquenchil96068872019-07-08 07:01:39 -0700269 name = "rules_cc",
philwo17506af2020-01-28 04:20:39 -0800270 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
271 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
oquenchil96068872019-07-08 07:01:39 -0700272)
273
Tony Aiutob15a8b42021-01-08 07:42:57 -0800274dist_http_archive(
iirinab815b792019-07-17 05:47:01 -0700275 name = "rules_java",
philwo17506af2020-01-28 04:20:39 -0800276 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
277 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
iirinab815b792019-07-17 05:47:01 -0700278)
279
Tony Aiuto320bc942021-01-14 07:43:21 -0800280dist_http_archive(
Yannic Bonenbergerff449692019-07-25 05:55:49 -0700281 name = "rules_proto",
philwo17506af2020-01-28 04:20:39 -0800282 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
283 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
Yannic Bonenbergerff449692019-07-25 05:55:49 -0700284)
285
Klaus Aehligacafe5a2018-10-24 03:16:42 -0700286# For testing, have an distdir_tar with all the archives implicit in every
287# WORKSPACE, to that they don't have to be refetched for every test
288# calling `bazel sync`.
289distdir_tar(
Jingwen Chen186929e2019-04-02 10:38:30 -0700290 name = "test_WORKSPACE_files",
philwo75edd782019-01-29 05:02:44 -0800291 archives = [
Googler18236ac2022-08-11 15:50:30 -0700292 "android_tools_pkg-0.27.0.tar.gz",
tedxae247142022-04-21 16:53:51 -0700293 "r8-3.3.28.jar",
philwo75edd782019-01-29 05:02:44 -0800294 ],
Jingwen Chen186929e2019-04-02 10:38:30 -0700295 dirname = "test_WORKSPACE/distdir",
Tony Aiutoe973aef2021-01-11 00:32:51 -0800296 dist_deps = {dep: attrs for dep, attrs in DIST_DEPS.items() if "test_WORKSPACE_files" in attrs["used_in"]},
philwo75edd782019-01-29 05:02:44 -0800297 sha256 = {
Googler18236ac2022-08-11 15:50:30 -0700298 "android_tools_pkg-0.27.0.tar.gz": "1afa4b7e13c82523c8b69e87f8d598c891ec7e2baa41d9e24e08becd723edb4d",
tedxae247142022-04-21 16:53:51 -0700299 "r8-3.3.28.jar": "8626ca32fb47aba7fddd2c897615e2e8ffcdb4d4b213572a2aefb3f838f01972",
philwo75edd782019-01-29 05:02:44 -0800300 },
301 urls = {
Googler18236ac2022-08-11 15:50:30 -0700302 "android_tools_pkg-0.27.0.tar.gz": [
303 "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.27.0.tar.gz",
Jingwen Chen186929e2019-04-02 10:38:30 -0700304 ],
tedxae247142022-04-21 16:53:51 -0700305 "r8-3.3.28.jar": [
306 "https://maven.google.com/com/android/tools/r8/3.3.28/r8-3.3.28.jar",
307 ],
philwo75edd782019-01-29 05:02:44 -0800308 },
Klaus Aehligacafe5a2018-10-24 03:16:42 -0700309)
Jingwen Chen186bdcd2018-12-14 10:27:23 -0800310
Tony Aiuto2b7ec5c2021-01-11 07:50:26 -0800311dist_http_archive(
312 name = "io_bazel_skydoc",
313)
314
Tony Aiutoe973aef2021-01-11 00:32:51 -0800315dist_http_archive(
hlopkoaaf64572019-06-14 02:33:56 -0700316 name = "platforms",
hlopkoaaf64572019-06-14 02:33:56 -0700317)
318
philwo17506af2020-01-28 04:20:39 -0800319# This must be kept in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/android/android_remote_tools.WORKSPACE
Ted Xiee7d50fc2022-11-15 11:55:05 -0800320# and tools/android/android_extensions.bzl
philwo17506af2020-01-28 04:20:39 -0800321http_archive(
322 name = "android_tools_for_testing",
323 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
324 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
Googler18236ac2022-08-11 15:50:30 -0700325 sha256 = "1afa4b7e13c82523c8b69e87f8d598c891ec7e2baa41d9e24e08becd723edb4d", # DO_NOT_REMOVE_THIS_ANDROID_TOOLS_UPDATE_MARKER
326 url = "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.27.0.tar.gz",
philwo17506af2020-01-28 04:20:39 -0800327)
328
tedxae247142022-04-21 16:53:51 -0700329# This must be kept in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/android/android_remote_tools.WORKSPACE
Ted Xiee7d50fc2022-11-15 11:55:05 -0800330# and tools/android/android_extensions.bzl
tedxae247142022-04-21 16:53:51 -0700331http_jar(
332 name = "android_gmaven_r8_for_testing",
333 sha256 = "8626ca32fb47aba7fddd2c897615e2e8ffcdb4d4b213572a2aefb3f838f01972",
334 url = "https://maven.google.com/com/android/tools/r8/3.3.28/r8-3.3.28.jar",
335)
336
aiutobbeb1da2021-01-15 06:50:56 -0800337dist_http_archive(
338 name = "remote_coverage_tools",
philwo17506af2020-01-28 04:20:39 -0800339 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
340 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800341)
342
Ivo Listb7411162022-01-14 09:53:01 -0800343dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800344 name = "remotejdk11_linux_for_testing",
345 build_file = "@local_jdk//:BUILD.bazel",
346 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
347 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800348)
349
Ivo Listb7411162022-01-14 09:53:01 -0800350dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800351 name = "remotejdk11_linux_aarch64_for_testing",
352 build_file = "@local_jdk//:BUILD.bazel",
353 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
354 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800355)
356
Ivo Listb7411162022-01-14 09:53:01 -0800357dist_http_archive(
Jason Furmanek04e073e2020-05-28 05:48:09 -0700358 name = "remotejdk11_linux_ppc64le_for_testing",
359 build_file = "@local_jdk//:BUILD.bazel",
360 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
361 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
Jason Furmanek04e073e2020-05-28 05:48:09 -0700362)
363
Ivo Listb7411162022-01-14 09:53:01 -0800364dist_http_archive(
Ruixin Baoe14a6f22020-08-21 06:17:24 -0700365 name = "remotejdk11_linux_s390x_for_testing",
366 build_file = "@local_jdk//:BUILD.bazel",
367 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
368 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
Ruixin Baoe14a6f22020-08-21 06:17:24 -0700369)
370
Ivo Listb7411162022-01-14 09:53:01 -0800371dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800372 name = "remotejdk11_macos_for_testing",
373 build_file = "@local_jdk//:BUILD.bazel",
374 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
375 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800376)
377
Ivo Listb7411162022-01-14 09:53:01 -0800378dist_http_archive(
Yun Peng8c7e11a2021-01-27 03:23:12 -0800379 name = "remotejdk11_macos_aarch64_for_testing",
380 build_file = "@local_jdk//:BUILD.bazel",
381 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
382 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
Yun Peng8c7e11a2021-01-27 03:23:12 -0800383)
384
Ivo Listb7411162022-01-14 09:53:01 -0800385dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800386 name = "remotejdk11_win_for_testing",
387 build_file = "@local_jdk//:BUILD.bazel",
388 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
389 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
cushon095f1e22022-02-08 10:54:53 -0800390)
philwo17506af2020-01-28 04:20:39 -0800391
Ivo Listb7411162022-01-14 09:53:01 -0800392dist_http_archive(
Niyas Saitb6024252022-02-10 06:59:31 -0800393 name = "remotejdk11_win_arm64_for_testing",
394 build_file = "@local_jdk//:BUILD.bazel",
395 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
396 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
Niyas Saitb6024252022-02-10 06:59:31 -0800397)
398
Liam Miller-Cushona7f1c712022-03-29 11:57:55 -0700399[
400 dist_http_archive(
401 name = "remotejdk%s_%s_for_testing" % (version, os),
402 build_file = "@local_jdk//:BUILD.bazel",
403 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
404 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
405 )
406 for version in ("17", "18")
407 for os in ("linux", "macos", "macos_aarch64", "win", "win_arm64")
408]
Niyas Saitb6024252022-02-10 06:59:31 -0800409
Tony Aiuto6a3d5f12021-01-12 13:38:32 -0800410# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
411dist_http_archive(
Ivo List62022712020-11-27 07:24:36 -0800412 name = "remote_java_tools_for_testing",
413 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
414 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
Ivo List62022712020-11-27 07:24:36 -0800415)
416
Tony Aiuto6a3d5f12021-01-12 13:38:32 -0800417# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
418dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800419 name = "remote_java_tools_linux_for_testing",
420 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
421 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800422)
423
Tony Aiuto6a3d5f12021-01-12 13:38:32 -0800424# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
425dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800426 name = "remote_java_tools_windows_for_testing",
427 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
428 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800429)
430
Tony Aiuto6a3d5f12021-01-12 13:38:32 -0800431# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
432dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800433 name = "remote_java_tools_darwin_for_testing",
434 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
435 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800436)
437
Tony Aiuto1bb1b522021-01-13 10:39:41 -0800438# Used in src/test/shell/bazel/testdata/jdk_http_archives.
439dist_http_archive(
Ivo List62022712020-11-27 07:24:36 -0800440 name = "remote_java_tools_test",
philwo17506af2020-01-28 04:20:39 -0800441 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
442 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800443)
444
Tony Aiuto1bb1b522021-01-13 10:39:41 -0800445# Used in src/test/shell/bazel/testdata/jdk_http_archives.
446dist_http_archive(
Ivo List62022712020-11-27 07:24:36 -0800447 name = "remote_java_tools_test_linux",
philwo17506af2020-01-28 04:20:39 -0800448 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
449 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800450)
451
Tony Aiuto1bb1b522021-01-13 10:39:41 -0800452# Used in src/test/shell/bazel/testdata/jdk_http_archives.
453dist_http_archive(
Ivo List62022712020-11-27 07:24:36 -0800454 name = "remote_java_tools_test_windows",
philwo17506af2020-01-28 04:20:39 -0800455 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
456 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
Ivo List62022712020-11-27 07:24:36 -0800457)
458
Tony Aiuto1bb1b522021-01-13 10:39:41 -0800459# Used in src/test/shell/bazel/testdata/jdk_http_archives.
460dist_http_archive(
Ivo List62022712020-11-27 07:24:36 -0800461 name = "remote_java_tools_test_darwin",
462 patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
463 patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
philwo17506af2020-01-28 04:20:39 -0800464)
465
Ivo Listb7411162022-01-14 09:53:01 -0800466dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800467 name = "openjdk11_linux_archive",
468 build_file_content = """
469java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public'])
470exports_files(["WORKSPACE"], visibility = ["//visibility:public"])
471""",
philwo17506af2020-01-28 04:20:39 -0800472)
473
474# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
cushon095f1e22022-02-08 10:54:53 -0800475dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800476 name = "openjdk11_darwin_archive",
477 build_file_content = """
478java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public'])
479exports_files(["WORKSPACE"], visibility = ["//visibility:public"])
480""",
philwo17506af2020-01-28 04:20:39 -0800481)
482
483# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
cushon095f1e22022-02-08 10:54:53 -0800484dist_http_archive(
Yun Peng8c7e11a2021-01-27 03:23:12 -0800485 name = "openjdk11_darwin_aarch64_archive",
486 build_file_content = """
487java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public'])
488exports_files(["WORKSPACE"], visibility = ["//visibility:public"])
489""",
Yun Peng8c7e11a2021-01-27 03:23:12 -0800490)
491
492# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
cushon095f1e22022-02-08 10:54:53 -0800493dist_http_archive(
philwo17506af2020-01-28 04:20:39 -0800494 name = "openjdk11_windows_archive",
495 build_file_content = """
496java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public'])
497exports_files(["WORKSPACE"], visibility = ["//visibility:public"])
498""",
philwo17506af2020-01-28 04:20:39 -0800499)
500
David Ostrovskyfe291f72020-07-23 04:08:29 -0700501# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
cushon095f1e22022-02-08 10:54:53 -0800502dist_http_archive(
Niyas Saitb6024252022-02-10 06:59:31 -0800503 name = "openjdk11_windows_arm64_archive",
504 build_file_content = """
505java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public'])
506exports_files(["WORKSPACE"], visibility = ["//visibility:public"])
507""",
508)
509
510# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
Liam Miller-Cushone4461d32022-03-30 13:06:59 -0700511[
512 dist_http_archive(
513 name = "openjdk%s_%s_archive" % (version, os),
514 build_file_content = """
Liam Miller-Cushoneb7bf8c2021-09-30 07:53:06 -0700515java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public'])
516exports_files(["WORKSPACE"], visibility = ["//visibility:public"])
517""",
Liam Miller-Cushone4461d32022-03-30 13:06:59 -0700518 )
519 for version in ("17", "18")
520 for os in ("linux", "darwin", "darwin_aarch64", "windows", "windows_arm64")
521]
Liam Miller-Cushona7f1c712022-03-29 11:57:55 -0700522
wyv8062ca42020-05-25 00:21:00 -0700523load("@io_bazel_skydoc//:setup.bzl", "stardoc_repositories")
iirinaf5c334262019-03-19 02:44:59 -0700524
wyv8062ca42020-05-25 00:21:00 -0700525stardoc_repositories()
Klaus Aehlig6f52fca2019-03-18 03:43:40 -0700526
Keith Smiley7fcbeec2019-04-23 17:06:02 -0700527register_execution_platforms("//:default_host_platform") # buildozer: disable=positional-args
Tony Aiutoed8a5ec2019-07-17 08:33:48 -0700528
529# Tools for building deb, rpm and tar files.
Tony Aiuto1c9e7ca2021-01-05 08:01:21 -0800530dist_http_archive(
Tony Aiutoed8a5ec2019-07-17 08:33:48 -0700531 name = "rules_pkg",
Tony Aiutoed8a5ec2019-07-17 08:33:48 -0700532)
iirinad26a3c12019-07-19 04:39:33 -0700533
Tony Aiutoed8a5ec2019-07-17 08:33:48 -0700534load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
iirinad26a3c12019-07-19 04:39:33 -0700535
Tony Aiutoed8a5ec2019-07-17 08:33:48 -0700536rules_pkg_dependencies()
Laszlo Csomor3e023182019-08-01 05:05:09 -0700537
538# Toolchains for Resource Compilation (.rc files on Windows).
539load("//src/main/res:winsdk_configure.bzl", "winsdk_configure")
540
541winsdk_configure(name = "local_config_winsdk")
542
543load("@local_config_winsdk//:toolchains.bzl", "register_local_rc_exe_toolchains")
544
545register_local_rc_exe_toolchains()
546
547register_toolchains("//src/main/res:empty_rc_toolchain")
Yun Peng01609b82020-05-04 11:12:33 -0700548
Tony Aiutoe973aef2021-01-11 00:32:51 -0800549dist_http_archive(
Yun Penge2f11d72020-06-03 09:16:35 -0700550 name = "com_github_grpc_grpc",
Yun Penge2f11d72020-06-03 09:16:35 -0700551)
552
Yun Pengb47aa712022-04-05 04:21:29 -0700553# Override the abseil-cpp version defined in grpc_deps(), which doesn't work on latest macOS
554# Fixes https://github.com/bazelbuild/bazel/issues/15168
555dist_http_archive(
556 name = "com_google_absl",
557)
558
Ara Nguyene58785c2022-07-25 13:39:13 -0700559# for patching the "com_github_cncf_udpa" deps loaded by grpc_deps
560dist_http_archive(
561 name = "com_envoyproxy_protoc_gen_validate",
562)
563
564dist_http_archive(
565 name = "com_github_cncf_udpa",
566)
567
568dist_http_archive(
569 name = "com_google_googleapis",
570)
571
572dist_http_archive(
573 name = "upb",
574)
575
576dist_http_archive(
577 name = "bazel_gazelle",
578)
579
Yun Peng3d7937e2023-01-10 06:43:02 -0800580dist_http_archive(
581 name = "rules_jvm_external",
582)
583
Yun Penge2f11d72020-06-03 09:16:35 -0700584# Projects using gRPC as an external dependency must call both grpc_deps() and
585# grpc_extra_deps().
586load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
Ivo List4c6c9992020-09-23 09:25:05 -0700587
Yun Penge2f11d72020-06-03 09:16:35 -0700588grpc_deps()
589
590load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
Ivo List4c6c9992020-09-23 09:25:05 -0700591
Yun Penge2f11d72020-06-03 09:16:35 -0700592grpc_extra_deps()
593
Yun Peng01609b82020-05-04 11:12:33 -0700594load("//tools/distributions/debian:deps.bzl", "debian_deps")
Ivo List4c6c9992020-09-23 09:25:05 -0700595
Yun Peng01609b82020-05-04 11:12:33 -0700596debian_deps()
Andrzej Guszak0f9a5922020-06-25 05:47:21 -0700597
598load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
Ivo List4c6c9992020-09-23 09:25:05 -0700599
Andrzej Guszak0f9a5922020-06-25 05:47:21 -0700600bazel_skylib_workspace()
Yun Peng3d7937e2023-01-10 06:43:02 -0800601
602load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
603
604rules_jvm_external_deps()
605
606load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
607
608rules_jvm_external_setup()
609
610load("@rules_jvm_external//:defs.bzl", "maven_install")
611
612maven_install(
613 artifacts = [
614 "com.google.guava:guava:31.1-jre",
615 "com.google.guava:guava-testlib:31.1-jre",
616 "com.google.guava:failureaccess:1.0.1",
617 "com.google.errorprone:error_prone_annotations:2.16",
618 "com.google.errorprone:error_prone_type_annotations:2.16",
619 "com.google.code.findbugs:jsr305:3.0.2",
620 "com.google.j2objc:j2objc-annotations:1.3",
621 "com.github.stephenc.jcip:jcip-annotations:1.0-1",
622 "org.checkerframework:checker-qual:3.12.0",
623 ],
624 repositories = [
625 "https://dl.google.com/android/maven2",
626 "https://repo1.maven.org/maven2",
627 ],
628 maven_install_json = "//:maven_install.json",
629)
630
631load("@maven//:defs.bzl", "pinned_maven_install")
632pinned_maven_install()