diff --git a/.github/workflows/unwanted_deps.sh b/.github/workflows/unwanted_deps.sh index c483f9730..a74ee003d 100755 --- a/.github/workflows/unwanted_deps.sh +++ b/.github/workflows/unwanted_deps.sh @@ -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 diff --git a/publish/BUILD.bazel b/publish/BUILD.bazel index 185c7fb7d..69766290e 100644 --- a/publish/BUILD.bazel +++ b/publish/BUILD.bazel @@ -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 @@ -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", +) diff --git a/publish/publish.sh b/publish/publish.sh index 28d0f0f53..d83016de3 100755 --- a/publish/publish.sh +++ b/publish/publish.sh @@ -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() { diff --git a/verifier/src/main/java/dev/cel/verifier/tools/BUILD.bazel b/verifier/src/main/java/dev/cel/verifier/tools/BUILD.bazel index 28ce776cb..1d2c7569e 100644 --- a/verifier/src/main/java/dev/cel/verifier/tools/BUILD.bazel +++ b/verifier/src/main/java/dev/cel/verifier/tools/BUILD.bazel @@ -6,6 +6,7 @@ package( "//:license", ], default_visibility = [ + "//publish:__pkg__", "//verifier:__subpackages__", ], ) diff --git a/verifier/tools/README.md b/verifier/tools/README.md index 398cbad74..b34422b27 100644 --- a/verifier/tools/README.md +++ b/verifier/tools/README.md @@ -6,6 +6,20 @@ and policy invariants without writing Java code. ## Running the CLI Tool +### Standalone Executable (Prebuilt JAR) + +You can download the standalone executable fat-JAR (`dev.cel:verifier-cli`) +directly from Maven Central and invoke it with `java -jar`: + + +```bash +# Download the latest CLI JAR +curl -LO https://repo1.maven.org/maven2/dev/cel/verifier-cli/0.13.1/verifier-cli-0.13.1.jar + +# Run the verifier CLI / REPL +java -jar verifier-cli-0.13.1.jar --help +``` + ### Running via Bazel ```bash @@ -27,11 +41,6 @@ bazel run //verifier/tools:cel_verifier_tool -- \ bazel run //verifier/tools:cel_verifier_tool -- repl ``` -### Running via Maven Central - -> **Note:** Executable binaries and Maven packages (`dev.cel:cel-verifier`) -> will be published to Maven Central in an upcoming release. - ## CLI Commands * `check-sat --expr "..."`: Verifies satisfiability of an expression and