Kent Ross | b6375e0 | 2019-02-26 10:07:55 -0800 | [diff] [blame] | 1 | """Load dependencies needed to compile the protobuf library as a 3rd-party consumer.""" |
| 2 | |
| 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 4 | |
Adam Cozzette | c7dfd0d | 2021-10-28 10:34:54 -0700 | [diff] [blame] | 5 | PROTOBUF_MAVEN_ARTIFACTS = [ |
Mike Kruskal | ed5c57a | 2022-08-10 22:51:29 -0700 | [diff] [blame] | 6 | "com.google.caliper:caliper:1.0-beta-3", |
Adam Cozzette | c7dfd0d | 2021-10-28 10:34:54 -0700 | [diff] [blame] | 7 | "com.google.code.findbugs:jsr305:3.0.2", |
Elliotte Rusty Harold | b73f78d | 2022-01-05 21:23:54 +0000 | [diff] [blame] | 8 | "com.google.code.gson:gson:2.8.9", |
Mike Kruskal | e71531a | 2022-08-12 13:16:40 -0700 | [diff] [blame] | 9 | "com.google.errorprone:error_prone_annotations:2.5.1", |
Adam Cozzette | c7dfd0d | 2021-10-28 10:34:54 -0700 | [diff] [blame] | 10 | "com.google.j2objc:j2objc-annotations:1.3", |
Elliotte Rusty Harold | 61dcf50 | 2022-03-30 20:52:15 +0000 | [diff] [blame] | 11 | "com.google.guava:guava:31.1-jre", |
| 12 | "com.google.guava:guava-testlib:31.1-jre", |
Adam Cozzette | c7dfd0d | 2021-10-28 10:34:54 -0700 | [diff] [blame] | 13 | "com.google.truth:truth:1.1.2", |
Elliotte Rusty Harold | 575d56b | 2022-03-22 21:54:53 +0000 | [diff] [blame] | 14 | "junit:junit:4.13.2", |
Adam Cozzette | f7232f2 | 2022-03-02 19:17:27 +0000 | [diff] [blame] | 15 | "org.mockito:mockito-core:4.3.1", |
Adam Cozzette | c7dfd0d | 2021-10-28 10:34:54 -0700 | [diff] [blame] | 16 | ] |
| 17 | |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 18 | def _github_archive(repo, commit, **kwargs): |
| 19 | repo_name = repo.split("/")[-1] |
| 20 | http_archive( |
| 21 | urls = [repo + "/archive/" + commit + ".zip"], |
| 22 | strip_prefix = repo_name + "-" + commit, |
| 23 | **kwargs |
| 24 | ) |
| 25 | |
Kent Ross | b6375e0 | 2019-02-26 10:07:55 -0800 | [diff] [blame] | 26 | def protobuf_deps(): |
| 27 | """Loads common dependencies needed to compile the protobuf library.""" |
| 28 | |
Yannic Bonenberger | bf0c69e | 2019-07-26 13:14:19 +0200 | [diff] [blame] | 29 | if not native.existing_rule("bazel_skylib"): |
| 30 | http_archive( |
| 31 | name = "bazel_skylib", |
Yannic | 948740b | 2020-01-15 19:27:35 +0100 | [diff] [blame] | 32 | urls = [ |
Xùdōng Yáng | 9f15059 | 2022-08-17 16:08:06 +0200 | [diff] [blame] | 33 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz", |
| 34 | "https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz", |
Yannic | 948740b | 2020-01-15 19:27:35 +0100 | [diff] [blame] | 35 | ], |
Xùdōng Yáng | 9f15059 | 2022-08-17 16:08:06 +0200 | [diff] [blame] | 36 | sha256 = "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728", |
Yannic Bonenberger | bf0c69e | 2019-07-26 13:14:19 +0200 | [diff] [blame] | 37 | ) |
| 38 | |
Adam Cozzette | 9bf0aca | 2022-04-08 09:12:05 -0700 | [diff] [blame] | 39 | if not native.existing_rule("com_google_absl"): |
| 40 | # Abseil LTS from November 2021 |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 41 | _github_archive( |
David L. Jones | 83303ba | 2022-04-21 17:38:03 -0700 | [diff] [blame] | 42 | name = "com_google_absl", |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 43 | repo = "https://github.com/abseil/abseil-cpp", |
Mike Kruskal | d8421bd | 2022-08-21 00:54:31 -0700 | [diff] [blame] | 44 | commit = "273292d1cfc0a94a65082ee350509af1d113344d", |
| 45 | sha256 = "6764f226bd6e2d8ab9fe2f3cab5f45fb1a4a15c04b58b87ba7fa87456054f98b", |
Adam Cozzette | 9bf0aca | 2022-04-08 09:12:05 -0700 | [diff] [blame] | 46 | ) |
| 47 | |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 48 | if not native.existing_rule("zlib"): |
Kent Ross | b6375e0 | 2019-02-26 10:07:55 -0800 | [diff] [blame] | 49 | http_archive( |
Nic McDonald | f313b9c | 2019-04-12 15:41:08 -0700 | [diff] [blame] | 50 | name = "zlib", |
Adam Cozzette | faa42e9 | 2022-03-29 15:50:39 -0400 | [diff] [blame] | 51 | build_file = "@com_google_protobuf//:third_party/zlib.BUILD", |
Keith Smiley | 516f8b1 | 2019-08-28 21:41:02 -0700 | [diff] [blame] | 52 | sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff", |
Kent Ross | b6375e0 | 2019-02-26 10:07:55 -0800 | [diff] [blame] | 53 | strip_prefix = "zlib-1.2.11", |
Keith Smiley | 516f8b1 | 2019-08-28 21:41:02 -0700 | [diff] [blame] | 54 | urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"], |
Kent Ross | b6375e0 | 2019-02-26 10:07:55 -0800 | [diff] [blame] | 55 | ) |
Adam Liddell | a74c43b | 2019-07-15 23:35:19 +0000 | [diff] [blame] | 56 | |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 57 | if not native.existing_rule("rules_cc"): |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 58 | _github_archive( |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 59 | name = "rules_cc", |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 60 | repo = "https://github.com/bazelbuild/rules_cc", |
| 61 | commit = "818289e5613731ae410efb54218a4077fb9dbb03", |
| 62 | sha256 = "0adbd6f567291ad526e82c765e15aed33cea5e256eeba129f1501142c2c56610", |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 63 | ) |
| 64 | |
| 65 | if not native.existing_rule("rules_java"): |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 66 | _github_archive( |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 67 | name = "rules_java", |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 68 | repo = "https://github.com/bazelbuild/rules_java", |
| 69 | commit = "981f06c3d2bd10225e85209904090eb7b5fb26bd", |
| 70 | sha256 = "7979ece89e82546b0dcd1dff7538c34b5a6ebc9148971106f0e3705444f00665", |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 71 | ) |
| 72 | |
| 73 | if not native.existing_rule("rules_proto"): |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 74 | _github_archive( |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 75 | name = "rules_proto", |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 76 | repo = "https://github.com/bazelbuild/rules_proto", |
| 77 | commit = "f7a30f6f80006b591fa7c437fe5a951eb10bcbcf", |
Dor | ee04809 | 2021-04-09 21:12:25 +0300 | [diff] [blame] | 78 | sha256 = "a4382f78723af788f0bc19fd4c8411f44ffe0a72723670a34692ffad56ada3ac", |
Yannic Bonenberger | d2d6ff5 | 2019-08-06 21:12:06 +0200 | [diff] [blame] | 79 | ) |
| 80 | |
| 81 | if not native.existing_rule("rules_python"): |
| 82 | http_archive( |
| 83 | name = "rules_python", |
Joshua Haberman | a6901f0 | 2022-04-25 22:00:57 +0000 | [diff] [blame] | 84 | sha256 = "9fcf91dbcc31fde6d1edb15f117246d912c33c36f44cf681976bd886538deba6", |
| 85 | strip_prefix = "rules_python-0.8.0", |
| 86 | url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.8.0.tar.gz", |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 87 | ) |
Derek Perez | bc45f92 | 2021-04-20 11:36:32 -0700 | [diff] [blame] | 88 | |
| 89 | if not native.existing_rule("rules_jvm_external"): |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 90 | _github_archive( |
Derek Perez | bc45f92 | 2021-04-20 11:36:32 -0700 | [diff] [blame] | 91 | name = "rules_jvm_external", |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 92 | repo = "https://github.com/bazelbuild/rules_jvm_external", |
| 93 | commit = "906875b0d5eaaf61a8ca2c9c3835bde6f435d011", |
Deanna Garcia | aafcb92 | 2022-02-28 18:28:50 +0000 | [diff] [blame] | 94 | sha256 = "744bd7436f63af7e9872948773b8b106016dc164acb3960b4963f86754532ee7", |
Derek Perez | bc45f92 | 2021-04-20 11:36:32 -0700 | [diff] [blame] | 95 | ) |
Deanna Garcia | 7924cd6 | 2022-01-13 00:10:23 +0000 | [diff] [blame] | 96 | |
Derek Perez | 3a4d931 | 2021-11-04 22:57:29 +0000 | [diff] [blame] | 97 | if not native.existing_rule("rules_pkg"): |
| 98 | http_archive( |
| 99 | name = "rules_pkg", |
| 100 | urls = [ |
David L. Jones | 83303ba | 2022-04-21 17:38:03 -0700 | [diff] [blame] | 101 | "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", |
| 102 | "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", |
Derek Perez | 3a4d931 | 2021-11-04 22:57:29 +0000 | [diff] [blame] | 103 | ], |
David L. Jones | 83303ba | 2022-04-21 17:38:03 -0700 | [diff] [blame] | 104 | sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", |
Derek Perez | 3a4d931 | 2021-11-04 22:57:29 +0000 | [diff] [blame] | 105 | ) |
Deanna Garcia | 7924cd6 | 2022-01-13 00:10:23 +0000 | [diff] [blame] | 106 | |
| 107 | if not native.existing_rule("io_bazel_rules_kotlin"): |
| 108 | http_archive( |
| 109 | name = "io_bazel_rules_kotlin", |
Xùdōng Yáng | eea1341 | 2022-07-05 14:49:57 +0200 | [diff] [blame] | 110 | urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/v1.7.0-RC-1/rules_kotlin_release.tgz"], |
| 111 | sha256 = "68b910730026921814d3a504ccbe9adaac9938983d940e626523e6e4ecfb0355", |
Deanna Garcia | 7924cd6 | 2022-01-13 00:10:23 +0000 | [diff] [blame] | 112 | ) |
Joshua Haberman | a6901f0 | 2022-04-25 22:00:57 +0000 | [diff] [blame] | 113 | |
| 114 | if not native.existing_rule("upb"): |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 115 | _github_archive( |
Joshua Haberman | a6901f0 | 2022-04-25 22:00:57 +0000 | [diff] [blame] | 116 | name = "upb", |
Joshua Haberman | 01691f6 | 2022-04-26 19:27:59 +0000 | [diff] [blame] | 117 | repo = "https://github.com/protocolbuffers/upb", |
Mike Kruskal | 081901b | 2022-09-09 13:03:37 -0700 | [diff] [blame] | 118 | commit = "5485645125ba3783ae2b597bd7b77679721cb1c6", |
| 119 | sha256 = "86de85c58eb3cb04b0987a7642ce84e55629f704ab4a9a0210a660a1115f1dd0", |
Joshua Haberman | a6901f0 | 2022-04-25 22:00:57 +0000 | [diff] [blame] | 120 | ) |