xref: /aosp_15_r20/external/tink/java_src/tink_java_deps.bzl (revision e7b1675dde1b92d52ec075b0a92829627f2c52a5)
1"""Dependencies of Java Tink."""
2
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
4
5TINK_MAVEN_ARTIFACTS = [
6    "com.google.protobuf:protobuf-java:3.19.6",
7    "com.google.protobuf:protobuf-javalite:3.19.6",
8    "com.amazonaws:aws-java-sdk-core:1.12.182",
9    "com.amazonaws:aws-java-sdk-kms:1.12.182",
10    "androidx.annotation:annotation:1.5.0",
11    "com.google.auto:auto-common:1.2.1",
12    "com.google.auto.service:auto-service:1.0.1",
13    "com.google.auto.service:auto-service-annotations:1.0.1",
14    "com.google.api-client:google-api-client:2.2.0",
15    "com.google.apis:google-api-services-cloudkms:v1-rev20221107-2.0.0",
16    "com.google.auth:google-auth-library-oauth2-http:1.5.3",
17    "com.google.code.findbugs:jsr305:3.0.2",
18    "com.google.code.gson:gson:2.10.1",
19    "com.google.errorprone:error_prone_annotations:2.18.0",
20    "com.google.http-client:google-http-client:1.43.1",
21    "com.google.http-client:google-http-client-gson:1.43.1",
22    "com.google.oauth-client:google-oauth-client:1.34.1",
23    "com.google.truth:truth:0.44",
24    "junit:junit:4.13.2",
25    "org.conscrypt:conscrypt-openjdk-uber:2.5.2",
26    "org.ow2.asm:asm:7.0",
27    "org.ow2.asm:asm-commons:7.0",
28    "org.pantsbuild:jarjar:1.7.2",
29]
30
31def tink_java_deps():
32    """Loads dependencies of Java Tink."""
33
34    # Google PKI certs for connecting to GCP KMS
35    if not native.existing_rule("google_root_pem"):
36        http_file(
37            name = "google_root_pem",
38            executable = 0,
39            urls = ["https://pki.goog/roots.pem"],
40            sha256 = "9c9b9685ad319b9747c3fe69b46a61c11a0efabdfa09ca6a8b0c3da421036d27",
41        )
42
43    # Basic rules we need to add to bazel.
44    if not native.existing_rule("bazel_skylib"):
45        # Release from 2021-09-27.
46        http_archive(
47            name = "bazel_skylib",
48            urls = [
49                "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
50                "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
51            ],
52            sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
53        )
54
55    # -------------------------------------------------------------------------
56    # Protobuf.
57    # -------------------------------------------------------------------------
58    # proto_library, cc_proto_library and java_proto_library rules implicitly
59    # depend respectively on:
60    #   * @com_google_protobuf//:proto
61    #   * @com_google_protobuf//:cc_toolchain
62    #   * @com_google_protobuf//:java_toolchain
63    # This statement defines the @com_google_protobuf repo.
64    if not native.existing_rule("com_google_protobuf"):
65        # Release X.21.9 from 2022-10-26.
66        http_archive(
67            name = "com_google_protobuf",
68            strip_prefix = "protobuf-21.9",
69            urls = ["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.9.zip"],
70            sha256 = "5babb8571f1cceafe0c18e13ddb3be556e87e12ceea3463d6b0d0064e6cc1ac3",
71        )
72
73    # -------------------------------------------------------------------------
74    # Transitive Maven artifact resolution and publishing rules for Bazel.
75    # -------------------------------------------------------------------------
76    if not native.existing_rule("rules_jvm_external"):
77        # Release from 2021-11-24
78        http_archive(
79            name = "rules_jvm_external",
80            strip_prefix = "rules_jvm_external-4.2",
81            sha256 = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca",
82            url = "https://github.com/bazelbuild/rules_jvm_external/archive/4.2.zip",
83        )
84
85    # -------------------------------------------------------------------------
86    # Android rules for Bazel.
87    # -------------------------------------------------------------------------
88    if not native.existing_rule("build_bazel_rules_android"):
89        # Last release from 2018-08-07.
90        http_archive(
91            name = "build_bazel_rules_android",
92            urls = ["https://github.com/bazelbuild/rules_android/archive/refs/tags/v0.1.1.zip"],
93            sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
94            strip_prefix = "rules_android-0.1.1",
95        )
96
97    # -------------------------------------------------------------------------
98    # Wycheproof.
99    # -------------------------------------------------------------------------
100    if not native.existing_rule("wycheproof"):
101        # Commit from 2019-12-17
102        http_archive(
103            name = "wycheproof",
104            strip_prefix = "wycheproof-d8ed1ba95ac4c551db67f410c06131c3bc00a97c",
105            url = "https://github.com/google/wycheproof/archive/d8ed1ba95ac4c551db67f410c06131c3bc00a97c.zip",
106            sha256 = "eb1d558071acf1aa6d677d7f1cabec2328d1cf8381496c17185bd92b52ce7545",
107        )
108