Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
153 lines
3.3 KiB
153 lines
3.3 KiB
load( |
|
"//bazel:upb_proto_library.bzl", |
|
"upb_proto_library", |
|
"upb_proto_reflection_library", |
|
) |
|
|
|
# begin:github_only |
|
load("@rules_pkg//:mappings.bzl", "pkg_files") |
|
# end:github_only |
|
|
|
licenses(["notice"]) |
|
|
|
# Def to Proto |
|
|
|
cc_library( |
|
name = "def_to_proto", |
|
srcs = ["def_to_proto.c"], |
|
hdrs = ["def_to_proto.h"], |
|
visibility = ["//visibility:public"], |
|
deps = [ |
|
"//:port", |
|
"//:reflection", |
|
"//:reflection_internal", |
|
], |
|
) |
|
|
|
proto_library( |
|
name = "def_to_proto_test_proto", |
|
srcs = [ |
|
"def_to_proto_public_import_test.proto", |
|
"def_to_proto_regular_import_test.proto", |
|
"def_to_proto_test.proto", |
|
], |
|
) |
|
|
|
upb_proto_library( |
|
name = "def_to_proto_test_upb_proto", |
|
deps = ["def_to_proto_test_proto"], |
|
) |
|
|
|
upb_proto_reflection_library( |
|
name = "def_to_proto_test_upb_proto_reflection", |
|
deps = ["def_to_proto_test_proto"], |
|
) |
|
|
|
cc_test( |
|
name = "def_to_proto_test", |
|
srcs = ["def_to_proto_test.cc"], |
|
deps = [ |
|
":def_to_proto", |
|
":def_to_proto_test_upb_proto", |
|
":def_to_proto_test_upb_proto_reflection", |
|
"//:descriptor_upb_proto_reflection", |
|
"//:reflection", |
|
"//:upb", |
|
"@com_google_absl//absl/strings", |
|
"@com_google_googletest//:gtest_main", |
|
"@com_google_protobuf//:protobuf", |
|
], |
|
) |
|
|
|
# Required fields |
|
|
|
cc_library( |
|
name = "required_fields", |
|
srcs = ["required_fields.c"], |
|
hdrs = ["required_fields.h"], |
|
visibility = ["//visibility:public"], |
|
deps = [ |
|
"//:collections", |
|
"//:port", |
|
"//:reflection", |
|
], |
|
) |
|
|
|
proto_library( |
|
name = "required_fields_test_proto", |
|
srcs = ["required_fields_test.proto"], |
|
) |
|
|
|
upb_proto_library( |
|
name = "required_fields_test_upb_proto", |
|
deps = ["required_fields_test_proto"], |
|
) |
|
|
|
upb_proto_reflection_library( |
|
name = "required_fields_test_upb_proto_reflection", |
|
deps = ["required_fields_test_proto"], |
|
) |
|
|
|
cc_test( |
|
name = "required_fields_test", |
|
srcs = ["required_fields_test.cc"], |
|
deps = [ |
|
":required_fields", |
|
":required_fields_test_upb_proto", |
|
":required_fields_test_upb_proto_reflection", |
|
"//:json", |
|
"//:reflection", |
|
"//:upb", |
|
"@com_google_absl//absl/strings", |
|
"@com_google_googletest//:gtest_main", |
|
], |
|
) |
|
|
|
# Compare |
|
|
|
cc_library( |
|
name = "compare", |
|
srcs = ["compare.c"], |
|
hdrs = ["compare.h"], |
|
visibility = ["//visibility:public"], |
|
deps = [ |
|
"//:eps_copy_input_stream", |
|
"//:port", |
|
"//:reflection", |
|
"//:wire_reader", |
|
"//:wire_types", |
|
], |
|
) |
|
|
|
cc_test( |
|
name = "compare_test", |
|
srcs = ["compare_test.cc"], |
|
# TODO(b/259158757): fix this test on Windows. |
|
target_compatible_with = select({ |
|
"@platforms//os:windows": ["//third_party/bazel_platforms:incompatible"], |
|
"//conditions:default": [], |
|
}), |
|
deps = [ |
|
":compare", |
|
"//:wire_internal", |
|
"//:wire_types", |
|
"@com_google_absl//absl/strings", |
|
"@com_google_googletest//:gtest_main", |
|
], |
|
) |
|
|
|
# begin:github_only |
|
pkg_files( |
|
name = "util_source_files", |
|
srcs = [ |
|
"compare.c", |
|
"compare.h", |
|
"def_to_proto.c", |
|
"def_to_proto.h", |
|
"required_fields.c", |
|
"required_fields.h", |
|
], |
|
prefix = "upb/util", |
|
visibility = ["//python/dist:__pkg__"], |
|
) |
|
# end:github_only
|
|
|