blob: de81ae82aae6a75e50350a0344cb485946d6c254 [file] [log] [blame]
Kent Rossb6375e02019-02-26 10:07:55 -08001"""Load dependencies needed to compile the protobuf library as a 3rd-party consumer."""
2
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -07005PROTOBUF_MAVEN_ARTIFACTS = [
6 "com.google.code.findbugs:jsr305:3.0.2",
Elliotte Rusty Haroldb73f78d2022-01-05 21:23:54 +00007 "com.google.code.gson:gson:2.8.9",
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -07008 "com.google.errorprone:error_prone_annotations:2.3.2",
9 "com.google.j2objc:j2objc-annotations:1.3",
10 "com.google.guava:guava:30.1.1-jre",
Deanna Garciadfd99e72022-01-12 21:54:30 +000011 "com.google.guava:guava-testlib:30.1.1-jre",
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070012 "com.google.truth:truth:1.1.2",
Elliotte Rusty Harold575d56b2022-03-22 21:54:53 +000013 "junit:junit:4.13.2",
Adam Cozzettef7232f22022-03-02 19:17:27 +000014 "org.mockito:mockito-core:4.3.1",
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070015]
16
Kent Rossb6375e02019-02-26 10:07:55 -080017def protobuf_deps():
18 """Loads common dependencies needed to compile the protobuf library."""
19
Yannic Bonenbergerbf0c69e2019-07-26 13:14:19 +020020 if not native.existing_rule("bazel_skylib"):
21 http_archive(
22 name = "bazel_skylib",
Yannic948740b2020-01-15 19:27:35 +010023 sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
24 urls = [
25 "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
26 "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
27 ],
Yannic Bonenbergerbf0c69e2019-07-26 13:14:19 +020028 )
29
Yannic Bonenberger6e899192019-07-23 16:28:57 +020030 if not native.existing_rule("zlib"):
Kent Rossb6375e02019-02-26 10:07:55 -080031 http_archive(
Nic McDonaldf313b9c2019-04-12 15:41:08 -070032 name = "zlib",
Xùdōng Yáng11de7482021-11-05 01:56:32 +110033 build_file = Label("//:third_party/zlib.BUILD"),
Keith Smiley516f8b12019-08-28 21:41:02 -070034 sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
Kent Rossb6375e02019-02-26 10:07:55 -080035 strip_prefix = "zlib-1.2.11",
Keith Smiley516f8b12019-08-28 21:41:02 -070036 urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"],
Kent Rossb6375e02019-02-26 10:07:55 -080037 )
Adam Liddella74c43b2019-07-15 23:35:19 +000038
Yannic Bonenberger6e899192019-07-23 16:28:57 +020039 if not native.existing_rule("rules_cc"):
40 http_archive(
41 name = "rules_cc",
Andreas Herrmann24fa9552020-05-26 10:07:20 +020042 sha256 = "9d48151ea71b3e225adfb6867e6d2c7d0dce46cbdc8710d9a9a628574dfd40a0",
43 strip_prefix = "rules_cc-818289e5613731ae410efb54218a4077fb9dbb03",
44 urls = ["https://github.com/bazelbuild/rules_cc/archive/818289e5613731ae410efb54218a4077fb9dbb03.tar.gz"],
Yannic Bonenberger6e899192019-07-23 16:28:57 +020045 )
46
47 if not native.existing_rule("rules_java"):
48 http_archive(
49 name = "rules_java",
50 sha256 = "f5a3e477e579231fca27bf202bb0e8fbe4fc6339d63b38ccb87c2760b533d1c3",
51 strip_prefix = "rules_java-981f06c3d2bd10225e85209904090eb7b5fb26bd",
52 urls = ["https://github.com/bazelbuild/rules_java/archive/981f06c3d2bd10225e85209904090eb7b5fb26bd.tar.gz"],
53 )
54
55 if not native.existing_rule("rules_proto"):
56 http_archive(
57 name = "rules_proto",
Doree048092021-04-09 21:12:25 +030058 sha256 = "a4382f78723af788f0bc19fd4c8411f44ffe0a72723670a34692ffad56ada3ac",
59 strip_prefix = "rules_proto-f7a30f6f80006b591fa7c437fe5a951eb10bcbcf",
60 urls = ["https://github.com/bazelbuild/rules_proto/archive/f7a30f6f80006b591fa7c437fe5a951eb10bcbcf.zip"],
Yannic Bonenbergerd2d6ff52019-08-06 21:12:06 +020061 )
62
63 if not native.existing_rule("rules_python"):
64 http_archive(
65 name = "rules_python",
Dirk Boye9eba6ed2021-10-13 22:54:54 +020066 sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
67 urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz"],
Yannic Bonenberger6e899192019-07-23 16:28:57 +020068 )
Derek Perezbc45f922021-04-20 11:36:32 -070069
70 if not native.existing_rule("rules_jvm_external"):
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070071 http_archive(
Derek Perezbc45f922021-04-20 11:36:32 -070072 name = "rules_jvm_external",
Deanna Garciaaafcb922022-02-28 18:28:50 +000073 sha256 = "744bd7436f63af7e9872948773b8b106016dc164acb3960b4963f86754532ee7",
74 strip_prefix = "rules_jvm_external-906875b0d5eaaf61a8ca2c9c3835bde6f435d011",
75 urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/906875b0d5eaaf61a8ca2c9c3835bde6f435d011.zip"],
Derek Perezbc45f922021-04-20 11:36:32 -070076 )
Deanna Garcia7924cd62022-01-13 00:10:23 +000077
Derek Perez3a4d9312021-11-04 22:57:29 +000078 if not native.existing_rule("rules_pkg"):
79 http_archive(
80 name = "rules_pkg",
81 urls = [
82 "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
83 "https://github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
84 ],
85 sha256 = "a89e203d3cf264e564fcb96b6e06dd70bc0557356eb48400ce4b5d97c2c3720d",
86 )
Deanna Garcia7924cd62022-01-13 00:10:23 +000087
88 if not native.existing_rule("io_bazel_rules_kotlin"):
89 http_archive(
90 name = "io_bazel_rules_kotlin",
91 urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/v1.5.0-beta-4/rules_kotlin_release.tgz"],
92 sha256 = "6cbd4e5768bdfae1598662e40272729ec9ece8b7bded8f0d2c81c8ff96dc139d",
93 )