Skip to content

Commit d39791a

Browse files
l46kokcopybara-github
authored andcommitted
Migrate to Bzlmod
PiperOrigin-RevId: 627072320
1 parent a8c7479 commit d39791a

File tree

6 files changed

+159
-327
lines changed

6 files changed

+159
-327
lines changed

.bazelrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
common --noenable_bzlmod
1+
common --enable_bzlmod
22
common --enable_workspace
33
build --java_runtime_version=remotejdk_11
44
build --java_language_version=11
55

66
# Hide Java 8 deprecation warnings.
77
common --javacopt=-Xlint:-options
8-

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ bazel-cel-java
66
bazel-out
77
bazel-testlogs
88

9-
MODULE.bazel*
10-
119
# IntelliJ IDEA
1210
.idea
1311
*.iml
@@ -32,3 +30,4 @@ target
3230
mvn-artifacts
3331

3432
*.swp
33+
*.lock

MODULE.bazel

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https:#www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
module(
16+
name = "cel_java",
17+
)
18+
19+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
20+
bazel_dep(name = "rules_jvm_external", version = "6.7")
21+
bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf") # see https://github.com/bazelbuild/rules_android/issues/373
22+
bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33.bcr.1", repo_name = "com_google_googleapis")
23+
bazel_dep(name = "rules_pkg", version = "1.0.1")
24+
bazel_dep(name = "rules_license", version = "1.0.0")
25+
bazel_dep(name = "rules_proto", version = "7.1.0")
26+
bazel_dep(name = "rules_java", version = "8.12.0")
27+
bazel_dep(name = "rules_android", version = "0.6.4")
28+
bazel_dep(name = "googleapis-java", version = "1.0.0")
29+
bazel_dep(name = "cel-spec", repo_name = "cel_spec", version = "0.24.0")
30+
31+
switched_rules = use_extension("@com_google_googleapis//:extensions.bzl", "switched_rules")
32+
switched_rules.use_languages(java = True)
33+
use_repo(switched_rules, "com_google_googleapis_imports")
34+
35+
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
36+
37+
GUAVA_VERSION = "33.4.8"
38+
TRUTH_VERSION = "1.4.4"
39+
40+
# Compile only artifacts
41+
[
42+
maven.artifact(
43+
neverlink = True,
44+
artifact = artifact,
45+
group = group,
46+
version = version,
47+
)
48+
for group, artifact, version in [coord.split(":") for coord in [
49+
"com.google.code.findbugs:annotations:3.0.1",
50+
"com.google.errorprone:error_prone_annotations:2.38.0",
51+
]]
52+
]
53+
54+
# Test only artifacts
55+
[
56+
maven.artifact(
57+
testonly = True,
58+
artifact = artifact,
59+
group = group,
60+
version = version,
61+
)
62+
for group, artifact, version in [coord.split(":") for coord in [
63+
"org.mockito:mockito-core:4.11.0",
64+
"io.github.classgraph:classgraph:4.8.179",
65+
"com.google.testparameterinjector:test-parameter-injector:1.18",
66+
"com.google.guava:guava-testlib:" + GUAVA_VERSION + "-jre",
67+
"com.google.truth.extensions:truth-java8-extension:" + TRUTH_VERSION,
68+
"com.google.truth.extensions:truth-proto-extension:" + TRUTH_VERSION,
69+
"com.google.truth.extensions:truth-liteproto-extension:" + TRUTH_VERSION,
70+
"com.google.truth:truth:" + TRUTH_VERSION,
71+
72+
]]
73+
]
74+
75+
maven.install(
76+
name = "maven",
77+
# keep sorted
78+
artifacts = [
79+
"com.google.auto.value:auto-value:1.11.0",
80+
"com.google.auto.value:auto-value-annotations:1.11.0",
81+
"com.google.guava:guava:" + GUAVA_VERSION + "-jre",
82+
"com.google.protobuf:protobuf-java:4.31.0",
83+
"com.google.protobuf:protobuf-java-util:4.31.0",
84+
"com.google.re2j:re2j:1.8",
85+
"info.picocli:picocli:4.7.7",
86+
"org.antlr:antlr4-runtime:4.13.2",
87+
"org.freemarker:freemarker:2.3.34",
88+
"org.jspecify:jspecify:1.0.0",
89+
"org.threeten:threeten-extra:1.8.0",
90+
"org.yaml:snakeyaml:2.4",
91+
],
92+
repositories = [
93+
"https://maven.google.com",
94+
"https://repo1.maven.org/maven2",
95+
],
96+
)
97+
98+
maven.install(
99+
name = "maven_android",
100+
# keep sorted
101+
artifacts = [
102+
"com.google.guava:guava:" + GUAVA_VERSION + "-android",
103+
"com.google.protobuf:protobuf-javalite:4.31.0",
104+
],
105+
repositories = [
106+
"https://maven.google.com",
107+
"https://repo1.maven.org/maven2",
108+
],
109+
)
110+
111+
use_repo(maven, "maven", "maven_android")
112+
113+
non_module_dependencies = use_extension("//:repositories.bzl", "non_module_dependencies")
114+
use_repo(non_module_dependencies, "antlr4_jar")
115+
use_repo(non_module_dependencies, "bazel_common")

0 commit comments

Comments
 (0)