Skip to content

Commit 6090008

Browse files
l46kokcopybara-github
authored andcommitted
Isolate CelAbstractSyntaxTree and CelSource from common build target
PiperOrigin-RevId: 715161676
1 parent b810258 commit 6090008

File tree

2 files changed

+65
-3
lines changed

2 files changed

+65
-3
lines changed

common/BUILD.bazel

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ package(
66
)
77

88
java_library(
9+
# TODO: Split this target and migrate consumers
910
name = "common",
10-
exports = ["//common/src/main/java/dev/cel/common"],
11+
exports = [
12+
"//common/src/main/java/dev/cel/common",
13+
"//common/src/main/java/dev/cel/common:cel_ast",
14+
"//common/src/main/java/dev/cel/common:cel_source",
15+
],
1116
)
1217

1318
java_library(
@@ -72,3 +77,13 @@ java_library(
7277
name = "source_location",
7378
exports = ["//common/src/main/java/dev/cel/common:source_location"],
7479
)
80+
81+
java_library(
82+
name = "cel_source",
83+
exports = ["//common/src/main/java/dev/cel/common:cel_source"],
84+
)
85+
86+
java_library(
87+
name = "cel_ast",
88+
exports = ["//common/src/main/java/dev/cel/common:cel_ast"],
89+
)

common/src/main/java/dev/cel/common/BUILD.bazel

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ package(
1010

1111
# keep sorted
1212
COMMON_SOURCES = [
13-
"CelAbstractSyntaxTree.java",
1413
"CelDescriptorUtil.java",
1514
"CelDescriptors.java",
1615
"CelException.java",
17-
"CelSource.java",
1816
]
1917

2018
# keep sorted
@@ -49,6 +47,8 @@ java_library(
4947
tags = [
5048
],
5149
deps = [
50+
":cel_ast",
51+
":cel_source",
5252
":error_codes",
5353
":source",
5454
":source_location",
@@ -72,6 +72,8 @@ java_library(
7272
tags = [
7373
],
7474
deps = [
75+
":cel_ast",
76+
":cel_source",
7577
":common",
7678
":source",
7779
":source_location",
@@ -116,6 +118,8 @@ java_library(
116118
tags = [
117119
],
118120
deps = [
121+
":cel_ast",
122+
":cel_source",
119123
"//common",
120124
"//common/ast:expr_converter",
121125
"//common/types:cel_proto_types",
@@ -131,7 +135,10 @@ java_library(
131135
tags = [
132136
],
133137
deps = [
138+
":cel_ast",
139+
":cel_source",
134140
":common",
141+
"//common:cel_source",
135142
"//common/ast:expr_v1alpha1_converter",
136143
"//common/types:cel_v1alpha1_types",
137144
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
@@ -164,6 +171,7 @@ java_library(
164171
tags = [
165172
],
166173
deps = [
174+
":cel_ast",
167175
":mutable_source",
168176
"//common",
169177
"//common/ast",
@@ -178,6 +186,7 @@ java_library(
178186
tags = [
179187
],
180188
deps = [
189+
":cel_source",
181190
":common",
182191
"//:auto_value",
183192
"//common/ast:mutable_expr",
@@ -213,6 +222,44 @@ java_library(
213222
],
214223
)
215224

225+
java_library(
226+
name = "cel_source",
227+
srcs = ["CelSource.java"],
228+
tags = [
229+
"alt_dep=//common:cel_source",
230+
"avoid_dep",
231+
],
232+
deps = [
233+
":source",
234+
":source_location",
235+
"//:auto_value",
236+
"//common/annotations",
237+
"//common/ast",
238+
"//common/internal",
239+
"@maven//:com_google_errorprone_error_prone_annotations",
240+
"@maven//:com_google_guava_guava",
241+
],
242+
)
243+
244+
java_library(
245+
name = "cel_ast",
246+
srcs = ["CelAbstractSyntaxTree.java"],
247+
tags = [
248+
"alt_dep=//common:cel_ast",
249+
"avoid_dep",
250+
],
251+
deps = [
252+
":cel_source",
253+
"//:auto_value",
254+
"//common/annotations",
255+
"//common/ast",
256+
"//common/types",
257+
"//common/types:type_providers",
258+
"@maven//:com_google_errorprone_error_prone_annotations",
259+
"@maven//:com_google_guava_guava",
260+
],
261+
)
262+
216263
java_library(
217264
name = "source",
218265
srcs = SOURCE_SOURCES,

0 commit comments

Comments
 (0)