Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/unwanted_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ checkUnwantedDeps '//publish:cel' '@maven_android//:com_google_protobuf_protobuf
# cel_runtime_android shouldn't depend on the full protobuf runtime or antlr
checkUnwantedDeps '//publish:cel_runtime_android' '@maven//:com_google_protobuf_protobuf_java'
checkUnwantedDeps '//publish:cel_runtime_android' '@maven//:org_antlr_antlr4_runtime'

# cel shouldn't depend on the verifier
checkUnwantedDeps '//publish:cel' '//verifier/'

exit 0
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ java_library(
neverlink = 1,
exports = [
"@maven//:com_google_auto_value_auto_value_annotations",
"@maven//:org_jspecify_jspecify",
],
)

Expand Down
55 changes: 31 additions & 24 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,41 @@ module(
name = "cel_java",
)

bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_jvm_external", version = "6.10")
bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf") # see https://github.com/bazelbuild/rules_android/issues/373
bazel_dep(name = "googleapis", version = "0.0.0-20260223-edfe7983", repo_name = "com_google_googleapis")
bazel_dep(name = "bazel_skylib", version = "1.9.2")
bazel_dep(name = "rules_jvm_external", version = "7.1")
bazel_dep(name = "protobuf", version = "35.1", repo_name = "com_google_protobuf") # see https://github.com/bazelbuild/rules_android/issues/373
bazel_dep(name = "googleapis", version = "0.0.0-20260728-b8486a2f", repo_name = "com_google_googleapis")
bazel_dep(name = "rules_pkg", version = "1.2.0")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_java", version = "9.3.0")
bazel_dep(name = "rules_android", version = "0.7.1")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "googleapis-java", version = "1.0.0")
bazel_dep(name = "cel-spec", version = "0.25.1", repo_name = "cel_spec")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_java", version = "9.7.0")
bazel_dep(name = "rules_android", version = "0.7.3")
bazel_dep(name = "rules_shell", version = "0.8.0")
bazel_dep(name = "googleapis-java", version = "1.1.5")
bazel_dep(name = "cel-spec", version = "0.25.2", repo_name = "cel_spec")
bazel_dep(name = "rules_go", version = "0.62.0")

# Required by cel-spec to satisfy gazelle transitive dependency
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.23.0")
go_sdk.download(version = "1.26.5")

switched_rules = use_extension("@com_google_googleapis//:extensions.bzl", "switched_rules")
switched_rules.use_languages(java = True)
use_repo(switched_rules, "com_google_googleapis_imports")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

GUAVA_VERSION = "33.5.0"
AUTO_VALUE_VERSION = "1.11.1"

TRUTH_VERSION = "1.4.4"
GUAVA_VERSION = "33.6.0"

PROTOBUF_JAVA_VERSION = "4.33.5"
JLINE_VERSION = "3.30.16"

CEL_VERSION = "0.13.1"
TRUTH_VERSION = "1.4.5"

PROTOBUF_JAVA_VERSION = "4.35.1"

CEL_VERSION = "0.14.0-SNAPSHOT"

# Compile only artifacts
[
Expand All @@ -58,7 +62,7 @@ CEL_VERSION = "0.13.1"
)
for group, artifact, version in [coord.split(":") for coord in [
"com.google.code.findbugs:annotations:3.0.1",
"com.google.errorprone:error_prone_annotations:2.42.0",
"com.google.errorprone:error_prone_annotations:2.50.0",
]]
]

Expand All @@ -72,8 +76,8 @@ CEL_VERSION = "0.13.1"
)
for group, artifact, version in [coord.split(":") for coord in [
"org.mockito:mockito-core:4.11.0",
"io.github.classgraph:classgraph:4.8.179",
"com.google.testparameterinjector:test-parameter-injector:1.18",
"io.github.classgraph:classgraph:4.8.186",
"com.google.testparameterinjector:test-parameter-injector:1.22",
"com.google.guava:guava-testlib:" + GUAVA_VERSION + "-jre",
"com.google.truth.extensions:truth-java8-extension:" + TRUTH_VERSION,
"com.google.truth.extensions:truth-proto-extension:" + TRUTH_VERSION,
Expand All @@ -86,22 +90,23 @@ maven.install(
name = "maven",
# keep sorted
artifacts = [
"com.google.auto.value:auto-value:1.11.0",
"com.google.auto.value:auto-value-annotations:1.11.0",
"com.google.auto.value:auto-value:" + AUTO_VALUE_VERSION,
"com.google.auto.value:auto-value-annotations:" + AUTO_VALUE_VERSION,
"com.google.guava:guava:" + GUAVA_VERSION + "-jre",
"com.google.protobuf:protobuf-java:" + PROTOBUF_JAVA_VERSION,
"com.google.protobuf:protobuf-java-util:" + PROTOBUF_JAVA_VERSION,
"com.google.re2j:re2j:1.8",
"info.picocli:picocli:4.7.7",
"org.antlr:antlr4-runtime:4.13.2",
"org.freemarker:freemarker:2.3.34",
"org.jline:jline-reader:3.26.1",
"org.jline:jline-terminal:3.26.1",
"org.jline:jline-reader:" + JLINE_VERSION,
"org.jline:jline-terminal:" + JLINE_VERSION,
"org.jspecify:jspecify:1.0.0",
"org.threeten:threeten-extra:1.8.0",
"org.yaml:snakeyaml:2.5",
"org.threeten:threeten-extra:1.10.0",
"org.yaml:snakeyaml:2.6",
"tools.aqua:z3-turnkey:4.14.1",
],
known_contributing_modules = ["protobuf"],
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
Expand Down Expand Up @@ -129,10 +134,12 @@ maven.install(
"dev.cel:compiler:" + CEL_VERSION,
"dev.cel:runtime:" + CEL_VERSION,
],
fail_on_missing_checksum = False,
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
"https://central.sonatype.com/repository/maven-snapshots/",
"m2local",
],
)
use_repo(maven, "maven", "maven_android", "maven_conformance")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ CEL-Java is available in Maven Central Repository. [Download the JARs here][8] o
<dependency>
<groupId>dev.cel</groupId>
<artifactId>cel</artifactId>
<version>0.13.1</version>
<version>0.14.0</version>
</dependency>
```

**Gradle**

```gradle
implementation 'dev.cel:cel:0.13.1'
implementation 'dev.cel:cel:0.14.0'
```

Then run this example:
Expand Down
2 changes: 2 additions & 0 deletions conformance/src/test/java/dev/cel/maven/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ MAVEN_RUNTIME_JAR_DEPS = [
java_test(
name = "compiler_artifact_test",
srcs = ["CompilerArtifactTest.java"],
tags = ["conformance_maven"],
test_class = "dev.cel.maven.CompilerArtifactTest",
deps =
MAVEN_COMPILER_JAR_DEPS + [
Expand All @@ -33,6 +34,7 @@ java_test(
java_test(
name = "runtime_artifact_test",
srcs = ["RuntimeArtifactTest.java"],
tags = ["conformance_maven"],
test_class = "dev.cel.maven.RuntimeArtifactTest",
deps =
MAVEN_RUNTIME_JAR_DEPS + [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,12 +712,10 @@ private enum TestErrorYamlPolicy {
DUPLICATE_VARIABLE("duplicate_variable"),
IMPORT("import"),
INCOMPATIBLE_OUTPUTS("incompatible_outputs"),
UNDECLARED_REFERENCE("undeclared_reference");
// TODO: Re-enable once cel-policy OSS dependency is updated with aggregate
// testdata.
// AGGREGATE_ERRORS("aggregate_errors"),
// AGGREGATE_LIST_ERRORS("aggregate_list_errors"),
// AGGREGATE_NESTED_MIXED_SEMANTICS("aggregate_nested_mixed_semantics");
UNDECLARED_REFERENCE("undeclared_reference"),
AGGREGATE_ERRORS("aggregate_errors"),
AGGREGATE_LIST_ERRORS("aggregate_list_errors"),
AGGREGATE_NESTED_MIXED_SEMANTICS("aggregate_nested_mixed_semantics");

private final String name;
private final String policyFilePath;
Expand Down
23 changes: 21 additions & 2 deletions publish/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_common//tools/maven:pom_file.bzl", "pom_file")
load("@rules_jvm_external//:defs.bzl", "java_export")
load("@rules_jvm_external//:defs.bzl", "java_export", "maven_export")
load("//publish:cel_version.bzl", "CEL_VERSION")

# Note: These targets must reference the build targets in `src` directly in
Expand Down Expand Up @@ -335,7 +335,7 @@ pom_file(
"CEL_VERSION": CEL_VERSION,
"CEL_ARTIFACT_ID": "verifier",
"PACKAGE_NAME": "CEL Java Verifier",
"PACKAGE_DESC": "Formal verification tools for Common Expression Language for Java.",
"PACKAGE_DESC": "Formal verification library for Common Expression Language for Java.",
},
targets = VERIFIER_TARGETS,
template_file = "pom_template.xml",
Expand All @@ -349,3 +349,22 @@ java_export(
pom_template = ":cel_verifier_pom",
exports = VERIFIER_TARGETS + [":cel"],
)

pom_file(
name = "cel_verifier_cli_pom",
substitutions = {
"CEL_VERSION": CEL_VERSION,
"CEL_ARTIFACT_ID": "verifier-cli",
"PACKAGE_NAME": "CEL Java Verifier CLI",
"PACKAGE_DESC": "Formal verification CLI and REPL tool for Common Expression Language for Java.",
},
targets = [],
template_file = "pom_template.xml",
)

maven_export(
name = "cel_verifier_cli",
maven_coordinates = "dev.cel:verifier-cli:%s" % CEL_VERSION,
pom_template = ":cel_verifier_cli_pom",
target = "//verifier/src/main/java/dev/cel/verifier/tools:cel_verifier_tool_deploy.jar",
)
2 changes: 1 addition & 1 deletion publish/cel_version.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Maven artifact version for CEL."""
CEL_VERSION = "0.13.1"
CEL_VERSION = "0.14.0-SNAPSHOT"
2 changes: 1 addition & 1 deletion publish/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

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

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")
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")
JDK8_FLAGS="--java_language_version=8 --java_runtime_version=8"

function publish_maven_remote() {
Expand Down
8 changes: 4 additions & 4 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def antlr4_jar_dependency():
)

def bazel_common_dependency():
bazel_common_tag = "aaa4d801588f7744c6f4428e4f133f26b8518f42"
bazel_common_sha = "1f85abb0043f3589b9bf13a80319dc48a5f01a052c68bab3c08015a56d92ab7f"
bazel_common_tag = "768dbe0b3247e2e5def0b9ac6c4cde95e214f18a"
bazel_common_sha = "b3f1fe7e26ade37712b00b82a0ab3760bb340e9307d57166872dacc679b78da1"
http_archive(
name = "bazel_common",
sha256 = bazel_common_sha,
Expand All @@ -34,8 +34,8 @@ def bazel_common_dependency():
)

def cel_policy_dependency():
cel_policy_tag = "e4c38defbbf34dfff2dc448dc58e93a9733ae8b1"
cel_policy_sha = "46378e0d17a16465899f9fefc94c3d44e1f40aedd8a31c9c0b2b6198048eabd6"
cel_policy_tag = "57ee86fea2ca3804c7722cc089e20a92fa15f902"
cel_policy_sha = "188609177ca930e8d5d2f5131b9522f345e06b8de500014b4e969e3977a7d687"
http_archive(
name = "cel_policy",
sha256 = cel_policy_sha,
Expand Down
7 changes: 7 additions & 0 deletions verifier/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@ java_library(
visibility = [":verifier_internal"],
exports = ["//verifier/src/main/java/dev/cel/verifier:z3_impl"],
)

java_library(
name = "canonicalization_optimizer",
compatible_with = [],
visibility = [":verifier_internal"],
exports = ["//verifier/src/main/java/dev/cel/verifier:canonicalization_optimizer"],
)
34 changes: 34 additions & 0 deletions verifier/src/main/java/dev/cel/verifier/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ java_library(
deps = [
":verifier",
":z3_impl",
"//bundle:cel",
"//checker:checker_builder",
"//compiler",
"//compiler:compiler_builder",
"//parser:parser_builder",
"//runtime",
],
)

Expand Down Expand Up @@ -119,6 +125,29 @@ java_library(
],
)

java_library(
name = "canonicalization_optimizer",
srcs = ["CanonicalizationOptimizer.java"],
tags = [
],
deps = [
"//:auto_value",
"//bundle:cel",
"//common:cel_ast",
"//common:mutable_ast",
"//common:mutable_source",
"//common:operator",
"//common/ast",
"//common/ast:mutable_expr",
"//common/navigation:common",
"//common/navigation:mutable_navigation",
"//common/values:cel_byte_string",
"//optimizer:ast_optimizer",
"//optimizer:mutable_ast",
"@maven//:com_google_guava_guava",
],
)

java_library(
name = "z3_impl",
srcs = [
Expand All @@ -135,10 +164,12 @@ java_library(
tags = [
],
deps = [
":canonicalization_optimizer",
":numeric_bounds",
":type_system",
":verifier",
"//:auto_value",
"//bundle:cel",
"//common:cel_ast",
"//common:compiler_common",
"//common:operator",
Expand All @@ -147,6 +178,9 @@ java_library(
"//common/types",
"//common/types:cel_types",
"//common/types:type_providers",
"//optimizer",
"//optimizer:optimization_exception",
"//optimizer:optimizer_builder",
"//verifier/axioms",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
Expand Down
Loading
Loading