Skip to content

Commit c1f5ab4

Browse files
l46kokcopybara-github
authored andcommitted
Include verifier and verifier-cli as publishable maven artifacts
PiperOrigin-RevId: 959864211
1 parent 2da98c9 commit c1f5ab4

16 files changed

Lines changed: 1496 additions & 57 deletions

.github/workflows/unwanted_deps.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ checkUnwantedDeps '//publish:cel' '@maven_android//:com_google_protobuf_protobuf
4646
# cel_runtime_android shouldn't depend on the full protobuf runtime or antlr
4747
checkUnwantedDeps '//publish:cel_runtime_android' '@maven//:com_google_protobuf_protobuf_java'
4848
checkUnwantedDeps '//publish:cel_runtime_android' '@maven//:org_antlr_antlr4_runtime'
49+
50+
# cel shouldn't depend on the verifier
51+
checkUnwantedDeps '//publish:cel' '//verifier/'
52+
4953
exit 0

publish/BUILD.bazel

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@bazel_common//tools/maven:pom_file.bzl", "pom_file")
2-
load("@rules_jvm_external//:defs.bzl", "java_export")
2+
load("@rules_jvm_external//:defs.bzl", "java_export", "maven_export")
33
load("//publish:cel_version.bzl", "CEL_VERSION")
44

55
# Note: These targets must reference the build targets in `src` directly in
@@ -349,3 +349,22 @@ java_export(
349349
pom_template = ":cel_verifier_pom",
350350
exports = VERIFIER_TARGETS + [":cel"],
351351
)
352+
353+
pom_file(
354+
name = "cel_verifier_cli_pom",
355+
substitutions = {
356+
"CEL_VERSION": CEL_VERSION,
357+
"CEL_ARTIFACT_ID": "verifier-cli",
358+
"PACKAGE_NAME": "CEL Java Verifier CLI",
359+
"PACKAGE_DESC": "Formal verification CLI and REPL tool for Common Expression Language for Java.",
360+
},
361+
targets = [],
362+
template_file = "pom_template.xml",
363+
)
364+
365+
maven_export(
366+
name = "cel_verifier_cli",
367+
maven_coordinates = "dev.cel:verifier-cli:%s" % CEL_VERSION,
368+
pom_template = ":cel_verifier_cli_pom",
369+
target = "//verifier/src/main/java/dev/cel/verifier/tools:cel_verifier_tool_deploy.jar",
370+
)

publish/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
# Note, to run script: Bazel and jq are required
2828

29-
ALL_TARGETS=("//publish:cel_common.publish" "//publish:cel.publish" "//publish:cel_compiler.publish" "//publish:cel_runtime.publish" "//publish:cel_v1alpha1.publish" "//publish:cel_protobuf.publish" "//publish:cel_runtime_android.publish")
29+
ALL_TARGETS=("//publish:cel_common.publish" "//publish:cel.publish" "//publish:cel_compiler.publish" "//publish:cel_runtime.publish" "//publish:cel_v1alpha1.publish" "//publish:cel_protobuf.publish" "//publish:cel_runtime_android.publish" "//publish:cel_verifier.publish" "//publish:cel_verifier_cli.publish")
3030
JDK8_FLAGS="--java_language_version=8 --java_runtime_version=8"
3131

3232
function publish_maven_remote() {

verifier/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,10 @@ java_library(
6161
visibility = [":verifier_internal"],
6262
exports = ["//verifier/src/main/java/dev/cel/verifier:z3_impl"],
6363
)
64+
65+
java_library(
66+
name = "canonicalization_optimizer",
67+
compatible_with = [],
68+
visibility = [":verifier_internal"],
69+
exports = ["//verifier/src/main/java/dev/cel/verifier:canonicalization_optimizer"],
70+
)

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ java_library(
3535
deps = [
3636
":verifier",
3737
":z3_impl",
38+
"//bundle:cel",
39+
"//checker:checker_builder",
40+
"//compiler",
41+
"//compiler:compiler_builder",
42+
"//parser:parser_builder",
43+
"//runtime",
3844
],
3945
)
4046

@@ -119,6 +125,29 @@ java_library(
119125
],
120126
)
121127

128+
java_library(
129+
name = "canonicalization_optimizer",
130+
srcs = ["CanonicalizationOptimizer.java"],
131+
tags = [
132+
],
133+
deps = [
134+
"//:auto_value",
135+
"//bundle:cel",
136+
"//common:cel_ast",
137+
"//common:mutable_ast",
138+
"//common:mutable_source",
139+
"//common:operator",
140+
"//common/ast",
141+
"//common/ast:mutable_expr",
142+
"//common/navigation:common",
143+
"//common/navigation:mutable_navigation",
144+
"//common/values:cel_byte_string",
145+
"//optimizer:ast_optimizer",
146+
"//optimizer:mutable_ast",
147+
"@maven//:com_google_guava_guava",
148+
],
149+
)
150+
122151
java_library(
123152
name = "z3_impl",
124153
srcs = [
@@ -135,10 +164,12 @@ java_library(
135164
tags = [
136165
],
137166
deps = [
167+
":canonicalization_optimizer",
138168
":numeric_bounds",
139169
":type_system",
140170
":verifier",
141171
"//:auto_value",
172+
"//bundle:cel",
142173
"//common:cel_ast",
143174
"//common:compiler_common",
144175
"//common:operator",
@@ -147,6 +178,9 @@ java_library(
147178
"//common/types",
148179
"//common/types:cel_types",
149180
"//common/types:type_providers",
181+
"//optimizer",
182+
"//optimizer:optimization_exception",
183+
"//optimizer:optimizer_builder",
150184
"//verifier/axioms",
151185
"@maven//:com_google_errorprone_error_prone_annotations",
152186
"@maven//:com_google_guava_guava",

0 commit comments

Comments
 (0)