Skip to content

Commit

Permalink
TypePool and proto conversion utilities
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 667682555
  • Loading branch information
jcking authored and copybara-github committed Aug 29, 2024
1 parent 5340cdb commit d4ffdcf
Show file tree
Hide file tree
Showing 22 changed files with 2,533 additions and 301 deletions.
12 changes: 6 additions & 6 deletions bazel/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
def base_deps():
"""Base evaluator and test dependencies."""

# Abseil LTS 20240116.2
ABSL_SHA1 = "d7aaad83b488fd62bd51c81ecf16cd938532cc0a"
ABSL_SHA256 = "68e7d36d621769ab500b2ebeec6a7910420566874b4b33b340a04bd70e67fe43"
# Abseil LTS 20240722.0
ABSL_SHA1 = "4447c7562e3bc702ade25105912dce503f0c4010"
ABSL_SHA256 = "d8342ad77aa9e16103c486b615460c24a695a1f04cdb760eb02fef780df99759"
http_archive(
name = "com_google_absl",
urls = ["https://github.com/abseil/abseil-cpp/archive/" + ABSL_SHA1 + ".zip"],
strip_prefix = "abseil-cpp-" + ABSL_SHA1,
sha256 = ABSL_SHA256,
)

# v1.14.0
GOOGLETEST_SHA1 = "f8d7d77c06936315286eb55f8de22cd23c188571"
GOOGLETEST_SHA256 = "b976cf4fd57b318afdb1bdb27fc708904b3e4bed482859eb94ba2b4bdd077fe2"
# v1.15.2
GOOGLETEST_SHA1 = "b514bdc898e2951020cbdca1304b75f5950d1f59"
GOOGLETEST_SHA256 = "8c0ceafa3ea24bf78e3519b7846d99e76c45899aa4dac4d64e7dd62e495de9fd"
http_archive(
name = "com_google_googletest",
urls = ["https://github.com/google/googletest/archive/" + GOOGLETEST_SHA1 + ".zip"],
Expand Down
159 changes: 159 additions & 0 deletions common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -913,3 +913,162 @@ cc_library(
"@com_google_absl//absl/utility",
],
)

cc_library(
name = "arena_string",
hdrs = ["arena_string.h"],
deps = [
"@com_google_absl//absl/base",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/strings:string_view",
],
)

cc_test(
name = "arena_string_test",
srcs = ["arena_string_test.cc"],
deps = [
":arena_string",
"//internal:testing",
"@com_google_absl//absl/hash",
"@com_google_absl//absl/hash:hash_testing",
"@com_google_absl//absl/strings:string_view",
],
)

cc_library(
name = "arena_string_pool",
hdrs = ["arena_string_pool.h"],
deps = [
":arena_string",
"//internal:string_pool",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/strings:string_view",
"@com_google_protobuf//:protobuf",
],
)

cc_test(
name = "arena_string_pool_test",
srcs = ["arena_string_pool_test.cc"],
deps = [
":arena_string_pool",
"//internal:testing",
"@com_google_protobuf//:protobuf",
],
)

cc_library(
name = "type_pool",
srcs = ["type_pool.cc"],
hdrs = ["type_pool.h"],
deps = [
":arena_string",
":arena_string_pool",
":type",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/strings:string_view",
"@com_google_absl//absl/types:span",
"@com_google_protobuf//:protobuf",
],
)

cc_test(
name = "type_pool_test",
srcs = ["type_pool_test.cc"],
deps = [
":arena_string_pool",
":type",
":type_pool",
"//internal:testing",
"//internal:testing_descriptor_pool",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/types:optional",
"@com_google_protobuf//:protobuf",
],
)

cc_library(
name = "type_proto",
srcs = ["type_proto.cc"],
hdrs = ["type_proto.h"],
deps = [
":type",
":type_kind",
":type_pool",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
"@com_google_cel_spec//proto/cel/expr:checked_cc_proto",
"@com_google_protobuf//:protobuf",
],
)

cc_test(
name = "type_proto_test",
srcs = ["type_proto_test.cc"],
deps = [
":arena_string_pool",
":type",
":type_pool",
":type_proto",
"//internal:proto_matchers",
"//internal:testing",
"//internal:testing_descriptor_pool",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:status_matchers",
"@com_google_absl//absl/types:optional",
"@com_google_cel_spec//proto/cel/expr:checked_cc_proto",
"@com_google_protobuf//:protobuf",
],
)

cc_library(
name = "type_proto_v1alpha1",
srcs = ["type_proto_v1alpha1.cc"],
hdrs = ["type_proto_v1alpha1.h"],
deps = [
":type",
":type_kind",
":type_pool",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
"@com_google_googleapis//google/api/expr/v1alpha1:checked_cc_proto",
"@com_google_protobuf//:protobuf",
],
)

cc_test(
name = "type_proto_v1alpha1_test",
srcs = ["type_proto_v1alpha1_test.cc"],
deps = [
":arena_string_pool",
":type",
":type_pool",
":type_proto_v1alpha1",
"//internal:proto_matchers",
"//internal:testing",
"//internal:testing_descriptor_pool",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:status_matchers",
"@com_google_absl//absl/types:optional",
"@com_google_googleapis//google/api/expr/v1alpha1:checked_cc_proto",
"@com_google_protobuf//:protobuf",
],
)
Loading

0 comments on commit d4ffdcf

Please sign in to comment.