Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 1 | # Copyright 2020 The Bazel Authors. All rights reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http:#www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
Xavier Bonaventura | fc4d9d6 | 2021-12-08 02:17:49 -0800 | [diff] [blame] | 14 | """List the distribution dependencies we need to build Bazel. |
| 15 | |
| 16 | Note for Bazel users: This is not the file that you are looking for. |
| 17 | This is internal source and is not intended to tell you what version |
| 18 | you should use for each dependency. |
| 19 | """ |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 20 | |
| 21 | DIST_DEPS = { |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 22 | ######################################## |
| 23 | # |
| 24 | # Runtime language dependencies |
| 25 | # |
| 26 | ######################################## |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 27 | "platforms": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 28 | "archive": "platforms-0.0.4.tar.gz", |
| 29 | "sha256": "079945598e4b6cc075846f7fd6a9d0857c33a7afc0de868c2ccb96405225135d", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 30 | "urls": [ |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 31 | "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz", |
| 32 | "https://github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 33 | ], |
| 34 | "used_in": [ |
| 35 | "additional_distfiles", |
| 36 | "test_WORKSPACE_files", |
| 37 | ], |
| 38 | }, |
Chi Wang | 26b94ff | 2021-09-28 23:42:26 -0700 | [diff] [blame] | 39 | "bazelci_rules": { |
| 40 | "archive": "bazelci_rules-1.0.0.tar.gz", |
| 41 | "sha256": "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e", |
| 42 | "strip_prefix": "bazelci_rules-1.0.0", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 43 | "urls": [ |
Chi Wang | 38a22d1 | 2021-12-06 08:30:58 -0800 | [diff] [blame] | 44 | "https://mirror.bazel.build/github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz", |
Chi Wang | 26b94ff | 2021-09-28 23:42:26 -0700 | [diff] [blame] | 45 | "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 46 | ], |
| 47 | "used_in": [ |
| 48 | "additional_distfiles", |
| 49 | ], |
| 50 | }, |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 51 | # Keep in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/cc_configure.WORKSPACE. |
| 52 | # Keep in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. |
| 53 | # Note: This is not in sync with src/test/java/com/google/devtools/build/lib/blackbox/framework/BlackBoxTestEnvironment.java. |
| 54 | # Perhaps it should be. |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 55 | "rules_cc": { |
| 56 | "archive": "b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 57 | "sha256": "d0c573b94a6ef20ef6ff20154a23d0efcb409fb0e1ff0979cec318dfe42f0cdd", |
| 58 | "strip_prefix": "rules_cc-b1c40e1de81913a3c40e5948f78719c28152486d", |
| 59 | "urls": [ |
| 60 | "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 61 | "https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 62 | ], |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 63 | "used_in": [ |
| 64 | "additional_distfiles", |
| 65 | "test_WORKSPACE_files", |
| 66 | ], |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 67 | }, |
Tony Aiuto | b15a8b4 | 2021-01-08 07:42:57 -0800 | [diff] [blame] | 68 | "rules_java": { |
| 69 | "archive": "7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", |
| 70 | "sha256": "bc81f1ba47ef5cc68ad32225c3d0e70b8c6f6077663835438da8d5733f917598", |
| 71 | "strip_prefix": "rules_java-7cf3cefd652008d0a64a419c34c13bdca6c8f178", |
| 72 | "urls": [ |
| 73 | "https://mirror.bazel.build/github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", |
| 74 | "https://github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", |
| 75 | ], |
| 76 | "used_in": [ |
| 77 | "additional_distfiles", |
| 78 | "test_WORKSPACE_files", |
| 79 | ], |
Tony Aiuto | b15a8b4 | 2021-01-08 07:42:57 -0800 | [diff] [blame] | 80 | }, |
Tony Aiuto | 320bc94 | 2021-01-14 07:43:21 -0800 | [diff] [blame] | 81 | # TODO(aiuto): Update src/test/java/com/google/devtools/build/lib/blackbox/framework/BlackBoxTestEnvironment.java to use |
| 82 | # this dynamically. |
| 83 | "rules_proto": { |
| 84 | "archive": "7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", |
| 85 | "sha256": "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da", |
| 86 | "strip_prefix": "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488", |
| 87 | "urls": [ |
| 88 | "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", |
| 89 | "https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", |
| 90 | ], |
| 91 | "used_in": [ |
| 92 | "additional_distfiles", |
| 93 | "test_WORKSPACE_files", |
| 94 | ], |
| 95 | }, |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 96 | ################################################# |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 97 | # |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 98 | # Dependencies which are part of the Bazel binary |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 99 | # |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 100 | ################################################# |
| 101 | "com_google_protobuf": { |
| 102 | "archive": "v3.13.0.tar.gz", |
| 103 | "sha256": "9b4ee22c250fe31b16f1a24d61467e40780a3fbb9b91c3b65be2a376ed913a1a", |
| 104 | "strip_prefix": "protobuf-3.13.0", |
| 105 | "urls": [ |
| 106 | "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz", |
| 107 | "https://github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz", |
| 108 | ], |
| 109 | "patch_args": ["-p1"], |
| 110 | "patches": ["//third_party/protobuf:3.13.0.patch"], |
| 111 | "used_in": [ |
| 112 | "additional_distfiles", |
| 113 | "test_WORKSPACE_files", |
| 114 | ], |
| 115 | }, |
Tony Aiuto | 320bc94 | 2021-01-14 07:43:21 -0800 | [diff] [blame] | 116 | "protocolbuffers": { |
Benjamin Peterson | c01219e | 2021-10-25 02:29:55 -0700 | [diff] [blame] | 117 | "archive": "2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", |
| 118 | "sha256": "6a5f67874af66b239b709c572ac1a5a00fdb1b29beaf13c3e6f79b1ba10dc7c4", |
Tony Aiuto | 320bc94 | 2021-01-14 07:43:21 -0800 | [diff] [blame] | 119 | "urls": [ |
Benjamin Peterson | c01219e | 2021-10-25 02:29:55 -0700 | [diff] [blame] | 120 | "https://mirror.bazel.build/github.com/protocolbuffers/upb/archive/2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", |
| 121 | "https://github.com/protocolbuffers/upb/archive/2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", |
Tony Aiuto | 320bc94 | 2021-01-14 07:43:21 -0800 | [diff] [blame] | 122 | ], |
| 123 | "used_in": [ |
| 124 | "additional_distfiles", |
| 125 | "test_WORKSPACE_files", |
| 126 | ], |
| 127 | }, |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 128 | "com_github_grpc_grpc": { |
Benjamin Peterson | c01219e | 2021-10-25 02:29:55 -0700 | [diff] [blame] | 129 | "archive": "v1.41.0.tar.gz", |
| 130 | "sha256": "e5fb30aae1fa1cffa4ce00aa0bbfab908c0b899fcf0bbc30e268367d660d8656", |
| 131 | "strip_prefix": "grpc-1.41.0", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 132 | "urls": [ |
Benjamin Peterson | c01219e | 2021-10-25 02:29:55 -0700 | [diff] [blame] | 133 | "https://mirror.bazel.build/github.com/grpc/grpc/archive/v1.41.0.tar.gz", |
| 134 | "https://github.com/grpc/grpc/archive/v1.41.0.tar.gz", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 135 | ], |
| 136 | "patch_args": ["-p1"], |
| 137 | "patches": [ |
Benjamin Peterson | c01219e | 2021-10-25 02:29:55 -0700 | [diff] [blame] | 138 | "//third_party/grpc:grpc_1.41.0.patch", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 139 | ], |
| 140 | "used_in": [ |
| 141 | "additional_distfiles", |
| 142 | "test_WORKSPACE_files", |
| 143 | ], |
| 144 | }, |
| 145 | "c-ares": { |
| 146 | "archive": "e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz", |
| 147 | "sha256": "e8c2751ddc70fed9dc6f999acd92e232d5846f009ee1674f8aee81f19b2b915a", |
| 148 | "urls": [ |
| 149 | "https://mirror.bazel.build/github.com/c-ares/c-ares/archive/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz", |
| 150 | "https://github.com/c-ares/c-ares/archive/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz", |
| 151 | ], |
| 152 | "used_in": [ |
| 153 | "additional_distfiles", |
| 154 | "test_WORKSPACE_files", |
| 155 | ], |
| 156 | }, |
| 157 | "re2": { |
| 158 | "archive": "aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz", |
| 159 | "sha256": "9f385e146410a8150b6f4cb1a57eab7ec806ced48d427554b1e754877ff26c3e", |
| 160 | "urls": [ |
| 161 | "https://mirror.bazel.build/github.com/google/re2/archive/aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz", |
| 162 | "https://github.com/google/re2/archive/aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz", |
| 163 | ], |
| 164 | "used_in": [ |
| 165 | "additional_distfiles", |
| 166 | "test_WORKSPACE_files", |
| 167 | ], |
| 168 | }, |
| 169 | "abseil-cpp": { |
Benjamin Peterson | c01219e | 2021-10-25 02:29:55 -0700 | [diff] [blame] | 170 | "archive": "997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz", |
| 171 | "sha256": "35f22ef5cb286f09954b7cc4c85b5a3f6221c9d4df6b8c4a1e9d399555b366ee", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 172 | "urls": [ |
Benjamin Peterson | c01219e | 2021-10-25 02:29:55 -0700 | [diff] [blame] | 173 | "https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz", |
| 174 | "https://github.com/abseil/abseil-cpp/archive/997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz", |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 175 | ], |
| 176 | "used_in": [ |
| 177 | "additional_distfiles", |
| 178 | "test_WORKSPACE_files", |
| 179 | ], |
| 180 | }, |
Alessandro Patti | 6da8086 | 2021-11-11 22:49:37 -0800 | [diff] [blame] | 181 | "zstd-jni": { |
| 182 | "archive": "v1.5.0-4.zip", |
| 183 | "patch_args": ["-p1"], |
| 184 | "patches": [ |
| 185 | "//third_party:zstd-jni/Native.java.patch", |
| 186 | ], |
| 187 | "sha256": "d320d59b89a163c5efccbe4915ae6a49883ce653cdc670643dfa21c6063108e4", |
| 188 | "urls": [ |
| 189 | "https://mirror.bazel.build/github.com/luben/zstd-jni/archive/v1.5.0-4.zip", |
| 190 | "https://github.com/luben/zstd-jni/archive/v1.5.0-4.zip", |
| 191 | ], |
| 192 | "used_in": [ |
| 193 | "additional_distfiles", |
| 194 | ], |
| 195 | }, |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 196 | ################################################### |
| 197 | # |
| 198 | # Build time dependencies for testing and packaging |
| 199 | # |
| 200 | ################################################### |
Tony Aiuto | 2b7ec5c | 2021-01-11 07:50:26 -0800 | [diff] [blame] | 201 | "bazel_skylib": { |
| 202 | "archive": "bazel-skylib-1.0.3.tar.gz", |
| 203 | "sha256": "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", |
| 204 | "urls": [ |
| 205 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", |
| 206 | "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", |
| 207 | ], |
| 208 | "used_in": [ |
| 209 | "additional_distfiles", |
| 210 | "test_WORKSPACE_files", |
| 211 | ], |
| 212 | }, |
| 213 | "io_bazel_skydoc": { |
| 214 | "archive": "1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz", |
| 215 | "sha256": "5a725b777976b77aa122b707d1b6f0f39b6020f66cd427bb111a585599c857b1", |
| 216 | "urls": [ |
| 217 | "https://mirror.bazel.build/github.com/bazelbuild/stardoc/archive/1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz", |
| 218 | "https://github.com/bazelbuild/stardoc/archive/1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz", |
| 219 | ], |
| 220 | "used_in": [ |
| 221 | "additional_distfiles", |
| 222 | ], |
| 223 | "strip_prefix": "stardoc-1ef781ced3b1443dca3ed05dec1989eca1a4e1cd", |
| 224 | }, |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 225 | "rules_pkg": { |
Tony Aiuto | 99079b3 | 2021-04-06 06:41:17 -0700 | [diff] [blame] | 226 | "archive": "rules_pkg-0.4.0.tar.gz", |
| 227 | "sha256": "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d", |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 228 | "urls": [ |
Tony Aiuto | 99079b3 | 2021-04-06 06:41:17 -0700 | [diff] [blame] | 229 | "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz", |
| 230 | "https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz", |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 231 | ], |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 232 | "used_in": [ |
| 233 | "additional_distfiles", |
| 234 | ], |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 235 | }, |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 236 | # for Stardoc |
| 237 | "io_bazel_rules_sass": { |
| 238 | "archive": "1.25.0.zip", |
| 239 | "sha256": "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", |
| 240 | "strip_prefix": "rules_sass-1.25.0", |
| 241 | "urls": [ |
| 242 | "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.0.zip", |
| 243 | "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", |
| 244 | ], |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 245 | "used_in": [ |
| 246 | "additional_distfiles", |
| 247 | ], |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 248 | }, |
| 249 | # for Stardoc |
| 250 | "build_bazel_rules_nodejs": { |
| 251 | "archive": "rules_nodejs-2.2.2.tar.gz", |
| 252 | "sha256": "f2194102720e662dbf193546585d705e645314319554c6ce7e47d8b59f459e9c", |
| 253 | "urls": [ |
| 254 | "https://mirror.bazel.build/github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz", |
| 255 | "https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz", |
| 256 | ], |
Tony Aiuto | e973aef | 2021-01-11 00:32:51 -0800 | [diff] [blame] | 257 | "used_in": [ |
| 258 | "additional_distfiles", |
| 259 | ], |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame] | 260 | }, |
menny | f431b0c | 2021-01-13 09:18:29 -0800 | [diff] [blame] | 261 | "desugar_jdk_libs": { |
Menny Even Danan | 29cfb0b | 2021-03-31 15:21:30 -0700 | [diff] [blame] | 262 | # Commit 5847d6a06302136d95a14b4cbd4b55a9c9f1436e of 2021-03-10 |
| 263 | "archive": "5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", |
| 264 | "sha256": "299452e6f4a4981b2e6d22357f7332713382a63e4c137f5fd6b89579f6d610cb", |
| 265 | "strip_prefix": "desugar_jdk_libs-5847d6a06302136d95a14b4cbd4b55a9c9f1436e", |
menny | f431b0c | 2021-01-13 09:18:29 -0800 | [diff] [blame] | 266 | "urls": [ |
Menny Even Danan | 29cfb0b | 2021-03-31 15:21:30 -0700 | [diff] [blame] | 267 | "https://mirror.bazel.build/github.com/google/desugar_jdk_libs/archive/5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", |
| 268 | "https://github.com/google/desugar_jdk_libs/archive/5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", |
menny | f431b0c | 2021-01-13 09:18:29 -0800 | [diff] [blame] | 269 | ], |
| 270 | "used_in": [ |
| 271 | "additional_distfiles", |
| 272 | ], |
| 273 | }, |
aiuto | bbeb1da | 2021-01-15 06:50:56 -0800 | [diff] [blame] | 274 | "remote_coverage_tools": { |
| 275 | "archive": "coverage_output_generator-v2.5.zip", |
| 276 | "sha256": "cd14f1cb4559e4723e63b7e7b06d09fcc3bd7ba58d03f354cdff1439bd936a7d", |
| 277 | "urls": [ |
| 278 | "https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.5.zip", |
| 279 | ], |
| 280 | "used_in": [ |
| 281 | "additional_distfiles", |
| 282 | "test_WORKSPACE_files", |
| 283 | ], |
| 284 | }, |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 285 | "remote_java_tools": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 286 | "aliases": [ |
| 287 | "remote_java_tools_test", |
| 288 | "remote_java_tools_for_testing", |
| 289 | ], |
hvadehra | d703b7b | 2021-11-18 12:24:25 -0800 | [diff] [blame] | 290 | "archive": "java_tools-v11.6.zip", |
| 291 | "sha256": "a7ac5922ee01e8b8fcb546ffc264ef314d0a0c679328b7fa4c432e5f54a86067", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 292 | "urls": [ |
hvadehra | d703b7b | 2021-11-18 12:24:25 -0800 | [diff] [blame] | 293 | "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.6/java_tools-v11.6.zip", |
| 294 | "https://github.com/bazelbuild/java_tools/releases/download/java_v11.6/java_tools-v11.6.zip", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 295 | ], |
| 296 | "used_in": [ |
| 297 | "additional_distfiles", |
| 298 | "test_WORKSPACE_files", |
| 299 | ], |
| 300 | }, |
| 301 | "remote_java_tools_linux": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 302 | "aliases": [ |
| 303 | "remote_java_tools_test_linux", |
| 304 | "remote_java_tools_linux_for_testing", |
| 305 | ], |
hvadehra | d703b7b | 2021-11-18 12:24:25 -0800 | [diff] [blame] | 306 | "archive": "java_tools_linux-v11.6.zip", |
| 307 | "sha256": "15da4f84a7d39cd179acf3035d9def638eea6ba89a0ed8f4e8a8e6e1d6c8e328", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 308 | "urls": [ |
hvadehra | d703b7b | 2021-11-18 12:24:25 -0800 | [diff] [blame] | 309 | "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.6/java_tools_linux-v11.6.zip", |
| 310 | "https://github.com/bazelbuild/java_tools/releases/download/java_v11.6/java_tools_linux-v11.6.zip", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 311 | ], |
| 312 | "used_in": [ |
| 313 | "additional_distfiles", |
| 314 | "test_WORKSPACE_files", |
| 315 | ], |
| 316 | }, |
| 317 | "remote_java_tools_windows": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 318 | "aliases": [ |
| 319 | "remote_java_tools_test_windows", |
| 320 | "remote_java_tools_windows_for_testing", |
| 321 | ], |
hvadehra | d703b7b | 2021-11-18 12:24:25 -0800 | [diff] [blame] | 322 | "archive": "java_tools_windows-v11.6.zip", |
| 323 | "sha256": "939f9d91f0df02851bbad8f5b1d26d24011329394cafe5668c1234e31ac2a1f7", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 324 | "urls": [ |
hvadehra | d703b7b | 2021-11-18 12:24:25 -0800 | [diff] [blame] | 325 | "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.6/java_tools_windows-v11.6.zip", |
| 326 | "https://github.com/bazelbuild/java_tools/releases/download/java_v11.6/java_tools_windows-v11.6.zip", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 327 | ], |
| 328 | "used_in": [ |
| 329 | "additional_distfiles", |
| 330 | "test_WORKSPACE_files", |
| 331 | ], |
| 332 | }, |
| 333 | "remote_java_tools_darwin": { |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 334 | "aliases": [ |
| 335 | "remote_java_tools_test_darwin", |
| 336 | "remote_java_tools_darwin_for_testing", |
| 337 | ], |
hvadehra | d703b7b | 2021-11-18 12:24:25 -0800 | [diff] [blame] | 338 | "archive": "java_tools_darwin-v11.6.zip", |
| 339 | "sha256": "f17ee54582b61f1ebd84c8fa2c54df796914cfbaac3cb821fb1286b55b080bc0", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 340 | "urls": [ |
hvadehra | d703b7b | 2021-11-18 12:24:25 -0800 | [diff] [blame] | 341 | "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.6/java_tools_darwin-v11.6.zip", |
| 342 | "https://github.com/bazelbuild/java_tools/releases/download/java_v11.6/java_tools_darwin-v11.6.zip", |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 343 | ], |
| 344 | "used_in": [ |
| 345 | "additional_distfiles", |
| 346 | "test_WORKSPACE_files", |
| 347 | ], |
| 348 | }, |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 349 | } |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 350 | |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 351 | # Add aliased names |
| 352 | DEPS_BY_NAME = {} |
| 353 | |
| 354 | def _create_index(): |
| 355 | for repo_name in DIST_DEPS: |
| 356 | repo = DIST_DEPS[repo_name] |
| 357 | DEPS_BY_NAME[repo_name] = repo |
| 358 | aliases = repo.get("aliases") |
| 359 | if aliases: |
| 360 | for alias in aliases: |
| 361 | DEPS_BY_NAME[alias] = repo |
| 362 | |
| 363 | _create_index() |
| 364 | |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 365 | def _gen_workspace_stanza_impl(ctx): |
| 366 | if ctx.attr.template and (ctx.attr.preamble or ctx.attr.postamble): |
| 367 | fail("Can not use template with either preamble or postamble") |
| 368 | |
Tony Aiuto | b15a8b4 | 2021-01-08 07:42:57 -0800 | [diff] [blame] | 369 | if ctx.attr.use_maybe: |
| 370 | repo_clause = """ |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 371 | maybe( |
| 372 | http_archive, |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 373 | name = "{repo}", |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 374 | sha256 = "{sha256}", |
| 375 | strip_prefix = {strip_prefix}, |
| 376 | urls = {urls}, |
| 377 | ) |
| 378 | """ |
Tony Aiuto | b15a8b4 | 2021-01-08 07:42:57 -0800 | [diff] [blame] | 379 | else: |
| 380 | repo_clause = """ |
| 381 | http_archive( |
| 382 | name = "{repo}", |
| 383 | sha256 = "{sha256}", |
| 384 | strip_prefix = {strip_prefix}, |
| 385 | urls = {urls}, |
| 386 | ) |
| 387 | """ |
| 388 | |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 389 | repo_stanzas = {} |
| 390 | for repo in ctx.attr.repos: |
Tony Aiuto | 6a3d5f1 | 2021-01-12 13:38:32 -0800 | [diff] [blame] | 391 | info = DEPS_BY_NAME[repo] |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 392 | strip_prefix = info.get("strip_prefix") |
| 393 | if strip_prefix: |
| 394 | strip_prefix = "\"%s\"" % strip_prefix |
| 395 | else: |
| 396 | strip_prefix = "None" |
| 397 | |
| 398 | repo_stanzas["{%s}" % repo] = repo_clause.format( |
| 399 | repo = repo, |
| 400 | archive = info["archive"], |
| 401 | sha256 = str(info["sha256"]), |
| 402 | strip_prefix = strip_prefix, |
| 403 | urls = info["urls"], |
| 404 | ) |
| 405 | |
| 406 | if ctx.attr.template: |
| 407 | ctx.actions.expand_template( |
| 408 | output = ctx.outputs.out, |
| 409 | template = ctx.file.template, |
| 410 | substitutions = repo_stanzas, |
| 411 | ) |
| 412 | else: |
| 413 | content = "\n".join([p.strip() for p in ctx.attr.preamble.strip().split("\n")]) |
| 414 | content += "\n" |
| 415 | content += "".join(repo_stanzas.values()) |
| 416 | content += "\n" |
| 417 | content += "\n".join([p.strip() for p in ctx.attr.postamble.strip().split("\n")]) |
| 418 | content += "\n" |
| 419 | ctx.actions.write(ctx.outputs.out, content) |
| 420 | |
| 421 | return [DefaultInfo(files = depset([ctx.outputs.out]))] |
| 422 | |
| 423 | gen_workspace_stanza = rule( |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 424 | attrs = { |
twerth | 69a0d1a | 2021-08-12 07:03:10 -0700 | [diff] [blame] | 425 | "repos": attr.string_list(doc = "Set of repos to include."), |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 426 | "out": attr.output(mandatory = True), |
| 427 | "preamble": attr.string(doc = "Preamble."), |
twerth | 69a0d1a | 2021-08-12 07:03:10 -0700 | [diff] [blame] | 428 | "postamble": attr.string(doc = "Set of rules to follow repos."), |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 429 | "template": attr.label( |
twerth | 69a0d1a | 2021-08-12 07:03:10 -0700 | [diff] [blame] | 430 | doc = "Template WORKSPACE file. May not be used with preamble or postamble." + |
| 431 | "Repo stanzas can be included using the syntax '{repo name}'.", |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 432 | allow_single_file = True, |
| 433 | mandatory = False, |
| 434 | ), |
twerth | 69a0d1a | 2021-08-12 07:03:10 -0700 | [diff] [blame] | 435 | "use_maybe": attr.bool(doc = "Use maybe() invocation instead of http_archive."), |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 436 | }, |
John Cater | 2cff2ac | 2021-02-26 07:38:37 -0800 | [diff] [blame] | 437 | doc = "Use specifications from DIST_DEPS to generate WORKSPACE http_archive stanzas or to" + |
| 438 | "drop them into a template.", |
| 439 | implementation = _gen_workspace_stanza_impl, |
Tony Aiuto | 3b2d310 | 2021-01-07 03:40:14 -0800 | [diff] [blame] | 440 | ) |