| # Copyright 2026 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| load("@rules_cc//cc:cc_test.bzl", "cc_test") |
| load("@rules_cc//cc:defs.bzl", "cc_library") |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| cc_library( |
| name = "constants", |
| hdrs = ["constants.h"], |
| deps = ["//uuid"], |
| ) |
| |
| cc_library( |
| name = "test_utils", |
| testonly = True, |
| srcs = ["test_utils.cc"], |
| hdrs = ["test_utils.h"], |
| deps = [ |
| ":constants", |
| "//uuid", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:cord", |
| "@abseil-cpp//absl/strings:string_view", |
| "@abseil-cpp//absl/types:span", |
| "@riegeli//riegeli/endian:endian_writing", |
| ], |
| ) |
| |
| cc_library( |
| name = "box", |
| hdrs = ["box.h"], |
| deps = [ |
| "//uuid", |
| "@abseil-cpp//absl/strings:string_view", |
| ], |
| ) |
| |
| cc_library( |
| name = "box_builder", |
| srcs = ["box_builder.cc"], |
| hdrs = ["box_builder.h"], |
| deps = [ |
| ":constants", |
| ":encode_params", |
| "//jumbf/internal:encode", |
| "//uuid", |
| "@abseil-cpp//absl/algorithm:container", |
| "@abseil-cpp//absl/log", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:cord", |
| "@abseil-cpp//absl/types:span", |
| "@riegeli//riegeli/bytes:cord_backward_writer", |
| ], |
| ) |
| |
| cc_test( |
| name = "box_builder_test", |
| srcs = ["box_builder_test.cc"], |
| deps = [ |
| ":box", |
| ":box_builder", |
| ":constants", |
| ":parse", |
| ":test_utils", |
| "//uuid", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/strings:cord", |
| "@abseil-cpp//absl/strings:string_view", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "parse", |
| srcs = ["parse.cc"], |
| hdrs = ["parse.h"], |
| deps = [ |
| ":box", |
| ":constants", |
| "//jumbf/internal:consume_box", |
| "//jumbf/internal:intermediate", |
| "//jumbf/internal:parse_embedded_file_description_box", |
| "//jumbf/internal:parse_super_box", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings:string_view", |
| ], |
| ) |
| |
| cc_test( |
| name = "parse_test", |
| srcs = ["parse_test.cc"], |
| deps = [ |
| ":box", |
| ":constants", |
| ":parse", |
| ":test_utils", |
| "//uuid", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@googletest//:gtest_main", |
| "@riegeli//riegeli/endian:endian_writing", |
| ], |
| ) |
| |
| cc_library( |
| name = "uri", |
| srcs = ["uri.cc"], |
| hdrs = ["uri.h"], |
| deps = [ |
| ":box", |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/log:die_if_null", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| ], |
| ) |
| |
| cc_test( |
| name = "uri_test", |
| srcs = ["uri_test.cc"], |
| deps = [ |
| ":box", |
| ":uri", |
| "//uuid", |
| "@abseil-cpp//absl/base:no_destructor", |
| "@abseil-cpp//absl/container:flat_hash_map", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "utils", |
| srcs = ["utils.cc"], |
| hdrs = ["utils.h"], |
| deps = [ |
| ":box", |
| ":constants", |
| "//jumbf/internal:serialization_utils", |
| "//uuid", |
| "@abseil-cpp//absl/functional:overload", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| ], |
| ) |
| |
| cc_library( |
| name = "encode_params", |
| hdrs = ["encode_params.h"], |
| deps = ["@abseil-cpp//absl/strings:cord"], |
| ) |
| |
| cc_test( |
| name = "utils_test", |
| srcs = ["utils_test.cc"], |
| deps = [ |
| ":box", |
| ":box_builder", |
| ":constants", |
| ":parse", |
| ":test_utils", |
| ":utils", |
| "//uuid", |
| "@abseil-cpp//absl/numeric:int128", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/strings:cord", |
| "@abseil-cpp//absl/strings:string_view", |
| "@googletest//:gtest_main", |
| "@riegeli//riegeli/endian:endian_writing", |
| ], |
| ) |
| |
| cc_library( |
| name = "convert_json", |
| srcs = ["convert_json.cc"], |
| hdrs = ["convert_json.h"], |
| deps = [ |
| ":box", |
| "@abseil-cpp//absl/log", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:str_format", |
| "@abseil-cpp//absl/strings:string_view", |
| "@libcppbor", |
| "@nlohmann_json//:json", |
| ], |
| ) |