Skip to content
Merged
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
1 change: 1 addition & 0 deletions bundle/src/main/java/dev/cel/bundle/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ java_library(
"//parser",
"//runtime",
"//runtime:runtime_planner_impl",
"@maven//:com_google_errorprone_error_prone_annotations",
],
)

Expand Down
16 changes: 16 additions & 0 deletions bundle/src/main/java/dev/cel/bundle/CelFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package dev.cel.bundle;

import com.google.errorprone.annotations.InlineMe;
import dev.cel.checker.CelCheckerLegacyImpl;
import dev.cel.common.CelOptions;
import dev.cel.compiler.CelCompiler;
Expand All @@ -34,8 +35,23 @@ private CelFactory() {}
*
* <p>Note, the {@link CelOptions#current}, standard CEL function libraries, and linked message
* evaluation are enabled by default.
*
* <p>Note: This standard builder currently proxies the legacy builder, which will be deprecated.
* Callers are strongly encouraged to migrate to the planner ({@link #plannerCelBuilder()}).
*/
@InlineMe(replacement = "CelFactory.legacyCelBuilder()", imports = "dev.cel.bundle.CelFactory")
public static CelBuilder standardCelBuilder() {
return legacyCelBuilder();
}

/**
* Creates a builder for configuring a legacy CEL using current parser for the parse, type-check,
* and eval of expressions.
*
* <p>Note: This legacy builder will be deprecated. Callers are strongly encouraged to migrate to
* the planner ({@link #plannerCelBuilder()}).
*/
public static CelBuilder legacyCelBuilder() {
return CelImpl.newBuilder(
CelCompilerImpl.newBuilder(
CelParserImpl.newBuilder(), CelCheckerLegacyImpl.newBuilder()),
Expand Down
1 change: 1 addition & 0 deletions runtime/src/main/java/dev/cel/runtime/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ java_library(
":runtime_legacy_impl",
":runtime_planner_impl",
"//common:options",
"@maven//:com_google_errorprone_error_prone_annotations",
],
)

Expand Down
17 changes: 17 additions & 0 deletions runtime/src/main/java/dev/cel/runtime/CelRuntimeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package dev.cel.runtime;

import com.google.errorprone.annotations.InlineMe;
import dev.cel.common.CelOptions;

/** Helper class to construct new {@code CelRuntime} instances. */
Expand All @@ -24,8 +25,24 @@ public final class CelRuntimeFactory {
*
* <p>Note, the {@link CelOptions#current}, standard CEL function libraries, and linked message
* evaluation are enabled by default.
*
* <p>Note: This standard runtime currently proxies the legacy runtime, which will be deprecated.
* Callers are strongly encouraged to migrate to the planner ({@link #plannerRuntimeBuilder()}).
*/
@InlineMe(
replacement = "CelRuntimeFactory.legacyCelRuntimeBuilder()",
imports = "dev.cel.runtime.CelRuntimeFactory")
public static CelRuntimeBuilder standardCelRuntimeBuilder() {
return legacyCelRuntimeBuilder();
}

/**
* Create a new builder for constructing a legacy {@code CelRuntime} instance.
*
* <p>Note: This legacy runtime will be deprecated. Callers are strongly encouraged to migrate to
* the planner ({@link #plannerRuntimeBuilder()}).
*/
public static CelRuntimeBuilder legacyCelRuntimeBuilder() {
return CelRuntimeLegacyImpl.newBuilder()
.setOptions(CelOptions.current().build())
// CEL-Internal-2
Expand Down
Loading