Skip to content

Commit d3788f1

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

6 files changed

Lines changed: 184 additions & 326 deletions

File tree

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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
5+
build --host_cxxopt='-std=c++17'
56

67
# Hide Java 8 deprecation warnings.
78
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.0", repo_name = "com_google_protobuf")
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+
30+
switched_rules = use_extension("@com_google_googleapis//:extensions.bzl", "switched_rules")
31+
switched_rules.use_languages(java = True)
32+
use_repo(switched_rules, "com_google_googleapis_imports")
33+
34+
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
35+
36+
GUAVA_VERSION = "33.4.8"
37+
TRUTH_VERSION = "1.4.4"
38+
39+
# Compile only artifacts
40+
[
41+
maven.artifact(
42+
neverlink = True,
43+
artifact = artifact,
44+
group = group,
45+
version = version,
46+
)
47+
for group, artifact, version in [coord.split(":") for coord in [
48+
"com.google.code.findbugs:annotations:3.0.1",
49+
"com.google.errorprone:error_prone_annotations:2.38.0",
50+
]]
51+
]
52+
53+
# Test only artifacts
54+
[
55+
maven.artifact(
56+
testonly = True,
57+
artifact = artifact,
58+
group = group,
59+
version = version,
60+
)
61+
for group, artifact, version in [coord.split(":") for coord in [
62+
"org.mockito:mockito-core:4.11.0",
63+
"io.github.classgraph:classgraph:4.8.179",
64+
"com.google.testparameterinjector:test-parameter-injector:1.18",
65+
"com.google.guava:guava-testlib:" + GUAVA_VERSION + "-jre",
66+
"com.google.truth.extensions:truth-java8-extension:" + TRUTH_VERSION,
67+
"com.google.truth.extensions:truth-proto-extension:" + TRUTH_VERSION,
68+
"com.google.truth.extensions:truth-liteproto-extension:" + TRUTH_VERSION,
69+
"com.google.truth:truth:" + TRUTH_VERSION,
70+
71+
]]
72+
]
73+
74+
maven.install(
75+
name = "maven",
76+
# keep sorted
77+
artifacts = [
78+
"com.google.auto.value:auto-value:1.11.0",
79+
"com.google.auto.value:auto-value-annotations:1.11.0",
80+
"com.google.guava:guava:" + GUAVA_VERSION + "-jre",
81+
"com.google.protobuf:protobuf-java:4.31.0",
82+
"com.google.protobuf:protobuf-java-util:4.31.0",
83+
"com.google.re2j:re2j:1.8",
84+
"info.picocli:picocli:4.7.7",
85+
"org.antlr:antlr4-runtime:4.13.2",
86+
"org.freemarker:freemarker:2.3.34",
87+
"org.jspecify:jspecify:1.0.0",
88+
"org.threeten:threeten-extra:1.8.0",
89+
"org.yaml:snakeyaml:2.4",
90+
],
91+
repositories = [
92+
"https://maven.google.com",
93+
"https://repo1.maven.org/maven2",
94+
],
95+
)
96+
97+
maven.install(
98+
name = "maven_android",
99+
# keep sorted
100+
artifacts = [
101+
"com.google.guava:guava:" + GUAVA_VERSION + "-android",
102+
"com.google.protobuf:protobuf-javalite:4.31.0",
103+
],
104+
repositories = [
105+
"https://maven.google.com",
106+
"https://repo1.maven.org/maven2",
107+
],
108+
)
109+
110+
use_repo(maven, "maven", "maven_android")
111+
112+
non_module_dependencies = use_extension("//:repositories.bzl", "non_module_dependencies")
113+
use_repo(non_module_dependencies, "antlr4_jar")
114+
use_repo(non_module_dependencies, "bazel_common")
115+
use_repo(non_module_dependencies, "cel_spec")

0 commit comments

Comments
 (0)