Skip to content

Commit c0cac78

Browse files
l46kokcopybara-github
authored andcommitted
Upgrade to Bazel 8, upgrade protobuf-java to 4.29.3
PiperOrigin-RevId: 724397841
1 parent 5f8ec78 commit c0cac78

File tree

6 files changed

+95
-39
lines changed

6 files changed

+95
-39
lines changed

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
common --noenable_bzlmod
22
common --enable_workspace
3+
build --java_runtime_version=remotejdk_8
4+
build --java_language_version=8
5+
6+
# Hide Java 8 deprecation warnings.
7+
common --javacopt=-Xlint:-options

.bazelversion

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ target
3030

3131
# Temporary output dir for artifacts
3232
mvn-artifacts
33+
34+
*.swp

BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ java_library(
9191
default_java_toolchain(
9292
name = "repository_default_toolchain",
9393
configuration = DEFAULT_TOOLCHAIN_CONFIGURATION,
94-
java_runtime = "@bazel_tools//tools/jdk:remote_jdk11",
9594
javacopts = DEFAULT_JAVACOPTS,
9695
jvm_opts = BASE_JDK9_JVM_OPTS,
9796
package_configuration = [

WORKSPACE

Lines changed: 78 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ register_toolchains("//:repository_default_toolchain_definition")
1818

1919
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
2020

21+
# Load license rules.
22+
# Must be loaded first due to https://github.com/bazel-contrib/rules_jvm_external/issues/1244
23+
24+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
25+
http_archive(
26+
name = "rules_license",
27+
urls = [
28+
"https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/1.0.0/rules_license-1.0.0.tar.gz",
29+
"https://github.com/bazelbuild/rules_license/releases/download/1.0.0/rules_license-1.0.0.tar.gz",
30+
],
31+
sha256 = "26d4021f6898e23b82ef953078389dd49ac2b5618ac564ade4ef87cced147b38",
32+
)
33+
2134
http_archive(
2235
name = "bazel_skylib",
2336
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
@@ -31,21 +44,64 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
3144

3245
bazel_skylib_workspace()
3346

34-
# Transitive dependency required by protobuf v4 https://github.com/protocolbuffers/protobuf/issues/17200
47+
### Protobuf Setup
48+
49+
http_archive(
50+
name = "rules_java",
51+
urls = [
52+
"https://github.com/bazelbuild/rules_java/releases/download/8.9.0/rules_java-8.9.0.tar.gz",
53+
],
54+
sha256 = "8daa0e4f800979c74387e4cd93f97e576ec6d52beab8ac94710d2931c57f8d8b",
55+
)
56+
3557
http_archive(
3658
name = "rules_python",
37-
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
38-
strip_prefix = "rules_python-0.34.0",
39-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
59+
sha256 = "9c6e26911a79fbf510a8f06d8eedb40f412023cf7fa6d1461def27116bff022c",
60+
strip_prefix = "rules_python-1.1.0",
61+
url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0/rules_python-1.1.0.tar.gz",
4062
)
4163

42-
load("@rules_python//python:repositories.bzl", "py_repositories")
64+
http_archive(
65+
name = "rules_proto",
66+
sha256 = "14a225870ab4e91869652cfd69ef2028277fc1dc4910d65d353b62d6e0ae21f4",
67+
strip_prefix = "rules_proto-7.1.0",
68+
url = "https://github.com/bazelbuild/rules_proto/releases/download/7.1.0/rules_proto-7.1.0.tar.gz",
69+
)
70+
71+
http_archive(
72+
name = "com_google_protobuf",
73+
sha256 = "008a11cc56f9b96679b4c285fd05f46d317d685be3ab524b2a310be0fbad987e",
74+
strip_prefix = "protobuf-29.3",
75+
urls = ["https://github.com/protocolbuffers/protobuf/archive/v29.3.tar.gz"],
76+
)
77+
78+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
79+
protobuf_deps()
80+
81+
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
82+
rules_java_dependencies()
4383

84+
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
85+
rules_java_toolchains()
86+
87+
load("@rules_python//python:repositories.bzl", "py_repositories")
4488
py_repositories()
4589

46-
RULES_JVM_EXTERNAL_TAG = "6.2"
90+
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
91+
rules_proto_dependencies()
92+
93+
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
94+
rules_proto_toolchains()
95+
96+
97+
### End of Protobuf Setup
98+
99+
100+
### rules_jvm_external setup
47101

48-
RULES_JVM_EXTERNAL_SHA = "808cb5c30b5f70d12a2a745a29edc46728fd35fa195c1762a596b63ae9cebe05"
102+
RULES_JVM_EXTERNAL_TAG = "6.6"
103+
104+
RULES_JVM_EXTERNAL_SHA = "3afe5195069bd379373528899c03a3072f568d33bd96fe037bd43b1f590535e7"
49105

50106
http_archive(
51107
name = "rules_jvm_external",
@@ -64,9 +120,10 @@ rules_jvm_external_setup()
64120

65121
load("@rules_jvm_external//:defs.bzl", "maven_install")
66122

67-
ANTLR4_VERSION = "4.13.2"
123+
### end of rules_jvm_external setup
68124

69125
# Important: there can only be one maven_install rule. Add new maven deps here.
126+
ANTLR4_VERSION = "4.13.2"
70127
maven_install(
71128
# keep sorted
72129
artifacts = [
@@ -76,8 +133,8 @@ maven_install(
76133
"com.google.errorprone:error_prone_annotations:2.36.0",
77134
"com.google.guava:guava:33.3.1-jre",
78135
"com.google.guava:guava-testlib:33.3.1-jre",
79-
"com.google.protobuf:protobuf-java:4.28.3",
80-
"com.google.protobuf:protobuf-java-util:4.28.3",
136+
"com.google.protobuf:protobuf-java:4.29.3",
137+
"com.google.protobuf:protobuf-java-util:4.29.3",
81138
"com.google.re2j:re2j:1.8",
82139
"com.google.testparameterinjector:test-parameter-injector:1.18",
83140
"com.google.truth.extensions:truth-java8-extension:1.4.4",
@@ -94,19 +151,9 @@ maven_install(
94151
],
95152
)
96153

97-
http_archive(
98-
name = "com_google_protobuf",
99-
sha256 = "7c3ebd7aaedd86fa5dc479a0fda803f602caaf78d8aff7ce83b89e1b8ae7442a",
100-
strip_prefix = "protobuf-28.3",
101-
urls = ["https://github.com/protocolbuffers/protobuf/archive/v28.3.tar.gz"],
102-
)
154+
### googleapis setup
103155

104-
# Required by com_google_protobuf
105-
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
106-
107-
protobuf_deps()
108-
109-
# googleapis as of 12/08/2022
156+
# as of 12/08/2022
110157
http_archive(
111158
name = "com_google_googleapis",
112159
sha256 = "8503282213779a3c230251218c924f385f457a053b4f82ff95d068f71815e558",
@@ -123,7 +170,6 @@ switched_rules_by_language(
123170
java = True,
124171
)
125172

126-
# Required by googleapis
127173
http_archive(
128174
name = "rules_pkg",
129175
sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
@@ -136,6 +182,10 @@ load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
136182

137183
rules_pkg_dependencies()
138184

185+
### end of googleapis setup
186+
187+
# bazel_common required for maven jar publishing
188+
139189
BAZEL_COMMON_TAG = "aaa4d801588f7744c6f4428e4f133f26b8518f42"
140190

141191
BAZEL_COMMON_SHA = "1f85abb0043f3589b9bf13a80319dc48a5f01a052c68bab3c08015a56d92ab7f"
@@ -148,16 +198,16 @@ http_archive(
148198
)
149199

150200
# cel-spec api/expr canonical protos
151-
# v0.19.0 2024-12-02
152-
CEL_SPEC_COMMIT = "afa18f9bd5a83f5960ca06c1f9faea406ab34ccc"
201+
CEL_SPEC_VERSION = "0.19.2"
153202

154203
http_archive(
155204
name = "cel_spec",
156-
sha256 = "3b74fc98b5efd10c53a220c694e80342db4e516151364dae97ec26dd308ce1c7",
157-
strip_prefix = "cel-spec-" + CEL_SPEC_COMMIT,
205+
sha256 = "f96bafe9d1c71784f631a20ccc890ae625959baf2083d00efdc883058065055a",
206+
strip_prefix = "cel-spec-" + CEL_SPEC_VERSION,
158207
urls = [
159208
"https://github.com/google/cel-spec/archive/" +
160-
CEL_SPEC_COMMIT + ".tar.gz",
209+
"v" + CEL_SPEC_VERSION +
210+
".tar.gz",
161211
],
162212
)
163213

@@ -177,12 +227,3 @@ http_jar(
177227
urls = ["https://www.antlr.org/download/antlr-" + ANTLR4_VERSION + "-complete.jar"],
178228
)
179229

180-
# Load license rules.
181-
http_archive(
182-
name = "rules_license",
183-
sha256 = "6157e1e68378532d0241ecd15d3c45f6e5cfd98fc10846045509fb2a7cc9e381",
184-
urls = [
185-
"https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
186-
"https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
187-
],
188-
)

publish/BUILD.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ EXCLUDED_TARGETS = [
6969
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
7070
]
7171

72+
JAVA_DOC_OPTIONS = [
73+
"-Xdoclint:none",
74+
"--ignore-source-errors",
75+
]
76+
7277
pom_file(
7378
name = "cel_pom",
7479
substitutions = {
@@ -84,6 +89,7 @@ pom_file(
8489
java_export(
8590
name = "cel",
8691
deploy_env = EXCLUDED_TARGETS,
92+
javadocopts = JAVA_DOC_OPTIONS,
8793
maven_coordinates = "dev.cel:cel:%s" % CEL_VERSION,
8894
pom_template = ":cel_pom",
8995
runtime_deps = ALL_TARGETS,
@@ -104,6 +110,7 @@ pom_file(
104110
java_export(
105111
name = "cel_compiler",
106112
deploy_env = EXCLUDED_TARGETS,
113+
javadocopts = JAVA_DOC_OPTIONS,
107114
maven_coordinates = "dev.cel:compiler:%s" % CEL_VERSION,
108115
pom_template = ":cel_compiler_pom",
109116
runtime_deps = COMPILER_TARGETS,
@@ -124,6 +131,7 @@ pom_file(
124131
java_export(
125132
name = "cel_runtime",
126133
deploy_env = EXCLUDED_TARGETS,
134+
javadocopts = JAVA_DOC_OPTIONS,
127135
maven_coordinates = "dev.cel:runtime:%s" % CEL_VERSION,
128136
pom_template = ":cel_runtime_pom",
129137
runtime_deps = RUNTIME_TARGETS,
@@ -144,6 +152,7 @@ pom_file(
144152
java_export(
145153
name = "cel_v1alpha1",
146154
deploy_env = EXCLUDED_TARGETS,
155+
javadocopts = JAVA_DOC_OPTIONS,
147156
maven_coordinates = "dev.cel:v1alpha1:%s" % CEL_VERSION,
148157
pom_template = ":cel_v1alpha1_pom",
149158
runtime_deps = V1ALPHA1_AST_TARGETS,
@@ -164,6 +173,7 @@ pom_file(
164173
java_export(
165174
name = "cel_protobuf",
166175
deploy_env = EXCLUDED_TARGETS,
176+
javadocopts = JAVA_DOC_OPTIONS,
167177
maven_coordinates = "dev.cel:protobuf:%s" % CEL_VERSION,
168178
pom_template = ":cel_protobuf_pom",
169179
runtime_deps = CANONICAL_AST_TARGETS,

0 commit comments

Comments
 (0)