Skip to content

Commit cf696c1

Browse files
morambrocopybara-github
authored andcommitted
Upgrade protobuf to 4.27.0 and Bazel to 6.4.0
#31 PiperOrigin-RevId: 638040988 Change-Id: I5edbf2133f33044eb6815f33a5ce8d47dfe1e4ec
1 parent b40b2d1 commit cf696c1

File tree

5 files changed

+61
-49
lines changed

5 files changed

+61
-49
lines changed

.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.0
1+
6.4.0

examples/.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.0
1+
6.4.0

examples/WORKSPACE

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
workspace(name = "tink_java_examples")
22

3-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4-
53
local_repository(
64
name = "tink_java",
75
path = "..",

maven/tink-java.pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<gson.version>2.10.1</gson.version>
8989
<error_prone_annotations.version>2.22.0</error_prone_annotations.version>
9090
<google-http-client.version>1.43.3</google-http-client.version>
91-
<protobuf-java.version>3.25.1</protobuf-java.version>
91+
<protobuf-java.version>4.27.0</protobuf-java.version>
9292
</properties>
9393

9494
<dependencies>

tink_java_deps.bzl

+58-44
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Dependencies for Tink Java."""
22

33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4+
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
45

56
TINK_MAVEN_ARTIFACTS = [
6-
"com.google.protobuf:protobuf-java:3.25.1",
7-
"com.google.protobuf:protobuf-javalite:3.25.1",
7+
"com.google.protobuf:protobuf-java:4.27.0",
8+
"com.google.protobuf:protobuf-javalite:4.27.0",
89
"androidx.annotation:annotation:1.5.0",
910
"com.google.api-client:google-api-client:2.2.0",
1011
"com.google.code.findbugs:jsr305:3.0.2",
@@ -23,16 +24,16 @@ def tink_java_deps():
2324
"""Loads dependencies of Java Tink."""
2425

2526
# Basic rules we need to add to bazel.
26-
if not native.existing_rule("bazel_skylib"):
27-
# Release from 2023-05-31.
28-
http_archive(
29-
name = "bazel_skylib",
30-
urls = [
31-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
32-
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
33-
],
34-
sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
35-
)
27+
# Release from 2023-05-31.
28+
maybe(
29+
http_archive,
30+
name = "bazel_skylib",
31+
urls = [
32+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
33+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
34+
],
35+
sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
36+
)
3637

3738
# -------------------------------------------------------------------------
3839
# Protobuf.
@@ -43,47 +44,60 @@ def tink_java_deps():
4344
# * @com_google_protobuf//:cc_toolchain
4445
# * @com_google_protobuf//:java_toolchain
4546
# This statement defines the @com_google_protobuf repo.
46-
if not native.existing_rule("com_google_protobuf"):
47-
# Release X.24.3 from 2023-09-07.
48-
http_archive(
49-
name = "com_google_protobuf",
50-
strip_prefix = "protobuf-24.3",
51-
urls = ["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v24.3.zip"],
52-
sha256 = "ace0abf35274ee0f08d5564635505ed55a0bc346a6534413d3c5b040fc926332",
53-
)
47+
# Release May 23rd, 2024.
48+
maybe(
49+
http_archive,
50+
name = "com_google_protobuf",
51+
strip_prefix = "protobuf-27.0",
52+
urls = ["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v27.0.zip"],
53+
sha256 = "a7e735f510520b41962d07459f6f5b99dd594c7ed4690bf1191b9924bec094a2",
54+
)
5455

5556
# -------------------------------------------------------------------------
5657
# Transitive Maven artifact resolution and publishing rules for Bazel.
5758
# -------------------------------------------------------------------------
58-
if not native.existing_rule("rules_jvm_external"):
59-
# Release from 2023-06-23
60-
http_archive(
61-
name = "rules_jvm_external",
62-
strip_prefix = "rules_jvm_external-5.3",
63-
url = "https://github.com/bazelbuild/rules_jvm_external/archive/5.3.zip",
64-
sha256 = "6cc8444b20307113a62b676846c29ff018402fd4c7097fcd6d0a0fd5f2e86429",
65-
)
59+
# Release from 2023-06-23
60+
maybe(
61+
http_archive,
62+
name = "rules_jvm_external",
63+
strip_prefix = "rules_jvm_external-5.3",
64+
url = "https://github.com/bazelbuild/rules_jvm_external/archive/5.3.zip",
65+
sha256 = "6cc8444b20307113a62b676846c29ff018402fd4c7097fcd6d0a0fd5f2e86429",
66+
)
6667

6768
# -------------------------------------------------------------------------
6869
# Android rules for Bazel.
6970
# -------------------------------------------------------------------------
70-
if not native.existing_rule("build_bazel_rules_android"):
71-
# Last release from 2018-08-07.
72-
http_archive(
73-
name = "build_bazel_rules_android",
74-
urls = ["https://github.com/bazelbuild/rules_android/archive/refs/tags/v0.1.1.zip"],
75-
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
76-
strip_prefix = "rules_android-0.1.1",
77-
)
71+
# Last release from 2018-08-07.
72+
maybe(
73+
http_archive,
74+
name = "build_bazel_rules_android",
75+
urls = ["https://github.com/bazelbuild/rules_android/archive/refs/tags/v0.1.1.zip"],
76+
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
77+
strip_prefix = "rules_android-0.1.1",
78+
)
7879

7980
# -------------------------------------------------------------------------
8081
# Wycheproof.
8182
# -------------------------------------------------------------------------
82-
if not native.existing_rule("wycheproof"):
83-
# Commit from 2019-12-17
84-
http_archive(
85-
name = "wycheproof",
86-
strip_prefix = "wycheproof-d8ed1ba95ac4c551db67f410c06131c3bc00a97c",
87-
url = "https://github.com/google/wycheproof/archive/d8ed1ba95ac4c551db67f410c06131c3bc00a97c.zip",
88-
sha256 = "eb1d558071acf1aa6d677d7f1cabec2328d1cf8381496c17185bd92b52ce7545",
89-
)
83+
# Commit from 2019-12-17
84+
maybe(
85+
http_archive,
86+
name = "wycheproof",
87+
strip_prefix = "wycheproof-d8ed1ba95ac4c551db67f410c06131c3bc00a97c",
88+
url = "https://github.com/google/wycheproof/archive/d8ed1ba95ac4c551db67f410c06131c3bc00a97c.zip",
89+
sha256 = "eb1d558071acf1aa6d677d7f1cabec2328d1cf8381496c17185bd92b52ce7545",
90+
)
91+
92+
# -------------------------------------------------------------------------
93+
# Rules Python.
94+
# -------------------------------------------------------------------------
95+
# Required by protobuf.
96+
# Release from Aug 22, 2023
97+
maybe(
98+
http_archive,
99+
name = "rules_python",
100+
sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036",
101+
strip_prefix = "rules_python-0.25.0",
102+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.25.0/rules_python-0.25.0.tar.gz",
103+
)

0 commit comments

Comments
 (0)