Skip to content

Commit b810258

Browse files
l46kokcopybara-github
authored andcommitted
Create a separate maven artifact for adapting canonical CEL protos (CelProtoAbstractSyntaxTree)
PiperOrigin-RevId: 715123218
1 parent 6ee7f7e commit b810258

File tree

2 files changed

+38
-17
lines changed

2 files changed

+38
-17
lines changed

publish/BUILD.bazel

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,27 @@ OPTIMIZER_TARGETS = [
4747
"//optimizer/src/main/java/dev/cel/optimizer/optimizers:common_subexpression_elimination",
4848
]
4949

50-
V1ALPHA1_UTILITY_TARGETS = [
50+
V1ALPHA1_AST_TARGETS = [
5151
"//common/src/main/java/dev/cel/common:proto_v1alpha1_ast",
5252
]
5353

54+
CANONICAL_AST_TARGETS = [
55+
"//common/src/main/java/dev/cel/common:proto_ast",
56+
]
57+
5458
EXTENSION_TARGETS = [
5559
"//extensions/src/main/java/dev/cel/extensions",
5660
"//extensions/src/main/java/dev/cel/extensions:optional_library",
5761
]
5862

5963
ALL_TARGETS = [
6064
"//bundle/src/main/java/dev/cel/bundle:cel",
61-
] + RUNTIME_TARGETS + COMPILER_TARGETS + EXTENSION_TARGETS + V1ALPHA1_UTILITY_TARGETS + OPTIMIZER_TARGETS + VALIDATOR_TARGETS
65+
] + RUNTIME_TARGETS + COMPILER_TARGETS + EXTENSION_TARGETS + V1ALPHA1_AST_TARGETS + CANONICAL_AST_TARGETS + OPTIMIZER_TARGETS + VALIDATOR_TARGETS
66+
67+
# Excluded from the JAR as their source of truth is elsewhere
68+
EXCLUDED_TARGETS = [
69+
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
70+
]
6271

6372
pom_file(
6473
name = "cel_pom",
@@ -74,9 +83,7 @@ pom_file(
7483

7584
java_export(
7685
name = "cel",
77-
deploy_env = [
78-
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
79-
],
86+
deploy_env = EXCLUDED_TARGETS,
8087
maven_coordinates = "dev.cel:cel:%s" % CEL_VERSION,
8188
pom_template = ":cel_pom",
8289
runtime_deps = ALL_TARGETS,
@@ -96,9 +103,7 @@ pom_file(
96103

97104
java_export(
98105
name = "cel_compiler",
99-
deploy_env = [
100-
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
101-
],
106+
deploy_env = EXCLUDED_TARGETS,
102107
maven_coordinates = "dev.cel:compiler:%s" % CEL_VERSION,
103108
pom_template = ":cel_compiler_pom",
104109
runtime_deps = COMPILER_TARGETS,
@@ -118,9 +123,7 @@ pom_file(
118123

119124
java_export(
120125
name = "cel_runtime",
121-
deploy_env = [
122-
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
123-
],
126+
deploy_env = EXCLUDED_TARGETS,
124127
maven_coordinates = "dev.cel:runtime:%s" % CEL_VERSION,
125128
pom_template = ":cel_runtime_pom",
126129
runtime_deps = RUNTIME_TARGETS,
@@ -134,16 +137,34 @@ pom_file(
134137
"PACKAGE_NAME": "CEL Java v1alpha1 Utility",
135138
"PACKAGE_DESC": "Common Expression Language Utility for supporting v1alpha1 protobuf definitions",
136139
},
137-
targets = V1ALPHA1_UTILITY_TARGETS,
140+
targets = V1ALPHA1_AST_TARGETS,
138141
template_file = "pom_template.xml",
139142
)
140143

141144
java_export(
142145
name = "cel_v1alpha1",
143-
deploy_env = [
144-
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
145-
],
146+
deploy_env = EXCLUDED_TARGETS,
146147
maven_coordinates = "dev.cel:v1alpha1:%s" % CEL_VERSION,
147148
pom_template = ":cel_v1alpha1_pom",
148-
runtime_deps = V1ALPHA1_UTILITY_TARGETS,
149+
runtime_deps = V1ALPHA1_AST_TARGETS,
150+
)
151+
152+
pom_file(
153+
name = "cel_protobuf_pom",
154+
substitutions = {
155+
"CEL_VERSION": CEL_VERSION,
156+
"CEL_ARTIFACT_ID": "protobuf",
157+
"PACKAGE_NAME": "CEL Java Protobuf adapter",
158+
"PACKAGE_DESC": "Common Expression Language Adapter for converting canonical cel.expr protobuf definitions",
159+
},
160+
targets = CANONICAL_AST_TARGETS,
161+
template_file = "pom_template.xml",
162+
)
163+
164+
java_export(
165+
name = "cel_protobuf",
166+
deploy_env = EXCLUDED_TARGETS,
167+
maven_coordinates = "dev.cel:protobuf:%s" % CEL_VERSION,
168+
pom_template = ":cel_protobuf_pom",
169+
runtime_deps = CANONICAL_AST_TARGETS,
149170
)

publish/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# 2. You will need to enter the key's password. The prompt appears in GUI, not in terminal. The publish operation will eventually timeout if the password is not entered.
2626

2727

28-
ALL_TARGETS=("//publish:cel.publish" "//publish:cel_compiler.publish" "//publish:cel_runtime.publish" "//publish:cel_v1alpha1.publish")
28+
ALL_TARGETS=("//publish:cel.publish" "//publish:cel_compiler.publish" "//publish:cel_runtime.publish" "//publish:cel_v1alpha1.publish" "//publish:cel_protobuf.publish")
2929

3030
function publish_maven_remote() {
3131
maven_repo_url=$1

0 commit comments

Comments
 (0)