Skip to content

Commit fdc5bc7

Browse files
l46kokcopybara-github
authored andcommitted
Introduce serializable CEL environment with YAML
PiperOrigin-RevId: 728443119
1 parent 0037aaa commit fdc5bc7

35 files changed

Lines changed: 2322 additions & 130 deletions

bundle/BUILD.bazel

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,21 @@ java_library(
99
name = "cel",
1010
exports = ["//bundle/src/main/java/dev/cel/bundle:cel"],
1111
)
12+
13+
java_library(
14+
name = "environment",
15+
visibility = ["//visibility:public"],
16+
exports = ["//bundle/src/main/java/dev/cel/bundle:environment"],
17+
)
18+
19+
java_library(
20+
name = "environment_exception",
21+
visibility = ["//visibility:public"],
22+
exports = ["//bundle/src/main/java/dev/cel/bundle:environment_exception"],
23+
)
24+
25+
java_library(
26+
name = "environment_yaml_parser",
27+
visibility = ["//visibility:public"],
28+
exports = ["//bundle/src/main/java/dev/cel/bundle:environment_yaml_parser"],
29+
)

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

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,72 @@ java_library(
4646
"@maven//:com_google_protobuf_protobuf_java",
4747
],
4848
)
49+
50+
java_library(
51+
name = "environment",
52+
srcs = [
53+
"CelEnvironment.java",
54+
],
55+
tags = [
56+
],
57+
deps = [
58+
":environment_exception",
59+
":required_fields_checker",
60+
"//:auto_value",
61+
"//bundle:cel",
62+
"//common:compiler_common",
63+
"//common:options",
64+
"//common:source",
65+
"//common/types",
66+
"//common/types:type_providers",
67+
"//extensions",
68+
"//extensions:optional_library",
69+
"@maven//:com_google_errorprone_error_prone_annotations",
70+
"@maven//:com_google_guava_guava",
71+
],
72+
)
73+
74+
java_library(
75+
name = "environment_exception",
76+
srcs = [
77+
"CelEnvironmentException.java",
78+
],
79+
tags = [
80+
],
81+
deps = ["//common:cel_exception"],
82+
)
83+
84+
java_library(
85+
name = "environment_yaml_parser",
86+
srcs = [
87+
"CelEnvironmentYamlParser.java",
88+
],
89+
tags = [
90+
],
91+
deps = [
92+
":environment",
93+
":environment_exception",
94+
"//common:compiler_common",
95+
"//common/formats:file_source",
96+
"//common/formats:parser_context",
97+
"//common/formats:yaml_helper",
98+
"//common/formats:yaml_parser_context_impl",
99+
"//common/internal",
100+
"@maven//:com_google_errorprone_error_prone_annotations",
101+
"@maven//:com_google_guava_guava",
102+
"@maven//:org_jspecify_jspecify",
103+
"@maven//:org_yaml_snakeyaml",
104+
],
105+
)
106+
107+
java_library(
108+
name = "required_fields_checker",
109+
srcs = [
110+
"RequiredFieldsChecker.java",
111+
],
112+
visibility = ["//visibility:private"],
113+
deps = [
114+
"//:auto_value",
115+
"@maven//:com_google_guava_guava",
116+
],
117+
)

0 commit comments

Comments
 (0)