Skip to content

Commit

Permalink
Isolate CelAbstractSyntaxTree and CelSource from common build target
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 715126056
  • Loading branch information
l46kok authored and copybara-github committed Jan 14, 2025
1 parent b810258 commit 969b6ea
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
17 changes: 16 additions & 1 deletion common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ package(
)

java_library(
# TODO: Split this target and migrate consumers
name = "common",
exports = ["//common/src/main/java/dev/cel/common"],
exports = [
"//common/src/main/java/dev/cel/common",
"//common/src/main/java/dev/cel/common:cel_ast",
"//common/src/main/java/dev/cel/common:cel_source",
],
)

java_library(
Expand Down Expand Up @@ -72,3 +77,13 @@ java_library(
name = "source_location",
exports = ["//common/src/main/java/dev/cel/common:source_location"],
)

java_library(
name = "cel_source",
exports = ["//common/src/main/java/dev/cel/common:cel_source"],
)

java_library(
name = "cel_ast",
exports = ["//common/src/main/java/dev/cel/common:cel_ast"],
)
51 changes: 49 additions & 2 deletions common/src/main/java/dev/cel/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ package(

# keep sorted
COMMON_SOURCES = [
"CelAbstractSyntaxTree.java",
"CelDescriptorUtil.java",
"CelDescriptors.java",
"CelException.java",
"CelSource.java",
]

# keep sorted
Expand Down Expand Up @@ -49,6 +47,8 @@ java_library(
tags = [
],
deps = [
":cel_ast",
":cel_source",
":error_codes",
":source",
":source_location",
Expand All @@ -72,6 +72,8 @@ java_library(
tags = [
],
deps = [
":cel_ast",
":cel_source",
":common",
":source",
":source_location",
Expand Down Expand Up @@ -116,6 +118,8 @@ java_library(
tags = [
],
deps = [
":cel_ast",
":cel_source",
"//common",
"//common/ast:expr_converter",
"//common/types:cel_proto_types",
Expand All @@ -131,7 +135,10 @@ java_library(
tags = [
],
deps = [
":cel_ast",
":cel_source",
":common",
"//common:cel_source",
"//common/ast:expr_v1alpha1_converter",
"//common/types:cel_v1alpha1_types",
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
Expand Down Expand Up @@ -164,6 +171,7 @@ java_library(
tags = [
],
deps = [
":cel_ast",
":mutable_source",
"//common",
"//common/ast",
Expand All @@ -178,6 +186,7 @@ java_library(
tags = [
],
deps = [
":cel_source",
":common",
"//:auto_value",
"//common/ast:mutable_expr",
Expand Down Expand Up @@ -213,6 +222,44 @@ java_library(
],
)

java_library(
name = "cel_source",
srcs = ["CelSource.java"],
tags = [
"alt_dep=//common:cel_source",
"avoid_dep",
],
deps = [
":source",
":source_location",
"//:auto_value",
"//common/annotations",
"//common/ast",
"//common/internal",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
],
)

java_library(
name = "cel_ast",
srcs = ["CelAbstractSyntaxTree.java"],
tags = [
"alt_dep=//common:cel_ast",
"avoid_dep",
],
deps = [
":cel_source",
"//:auto_value",
"//common/annotations",
"//common/ast",
"//common/types",
"//common/types:type_providers",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
],
)

java_library(
name = "source",
srcs = SOURCE_SOURCES,
Expand Down

0 comments on commit 969b6ea

Please sign in to comment.