• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""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
5PROTOBUF_MAVEN_ARTIFACTS = [
6    "com.google.code.findbugs:jsr305:3.0.2",
7    "com.google.code.gson:gson:2.8.9",
8    "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",
11    "com.google.guava:guava-testlib:30.1.1-jre",
12    "com.google.truth:truth:1.1.2",
13    "junit:junit:4.12",
14    "org.mockito:mockito-core:4.3.1",
15]
16
17def protobuf_deps():
18    """Loads common dependencies needed to compile the protobuf library."""
19
20    if not native.existing_rule("bazel_skylib"):
21        http_archive(
22            name = "bazel_skylib",
23            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            ],
28        )
29
30    if not native.existing_rule("zlib"):
31        http_archive(
32            name = "zlib",
33            build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
34            sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
35            strip_prefix = "zlib-1.2.11",
36            urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"],
37        )
38
39    if not native.existing_rule("rules_cc"):
40        http_archive(
41            name = "rules_cc",
42            sha256 = "9d48151ea71b3e225adfb6867e6d2c7d0dce46cbdc8710d9a9a628574dfd40a0",
43            strip_prefix = "rules_cc-818289e5613731ae410efb54218a4077fb9dbb03",
44            urls = ["https://github.com/bazelbuild/rules_cc/archive/818289e5613731ae410efb54218a4077fb9dbb03.tar.gz"],
45        )
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",
58            sha256 = "a4382f78723af788f0bc19fd4c8411f44ffe0a72723670a34692ffad56ada3ac",
59            strip_prefix = "rules_proto-f7a30f6f80006b591fa7c437fe5a951eb10bcbcf",
60            urls = ["https://github.com/bazelbuild/rules_proto/archive/f7a30f6f80006b591fa7c437fe5a951eb10bcbcf.zip"],
61        )
62
63    if not native.existing_rule("rules_python"):
64        http_archive(
65            name = "rules_python",
66            sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
67            urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz"],
68        )
69
70    if not native.existing_rule("rules_jvm_external"):
71        http_archive(
72            name = "rules_jvm_external",
73            sha256 = "744bd7436f63af7e9872948773b8b106016dc164acb3960b4963f86754532ee7",
74            strip_prefix = "rules_jvm_external-906875b0d5eaaf61a8ca2c9c3835bde6f435d011",
75            urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/906875b0d5eaaf61a8ca2c9c3835bde6f435d011.zip"],
76        )
77
78    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        )
87
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        )
94