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.
282 lines
7.7 KiB
282 lines
7.7 KiB
11 months ago
|
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
||
10 months ago
|
load("//:protobuf.bzl", "internal_objc_proto_library", "internal_py_proto_library")
|
||
11 months ago
|
load("//bazel:cc_proto_library.bzl", "cc_proto_library")
|
||
1 year ago
|
load("//bazel:upb_proto_library.bzl", "upb_c_proto_library", "upb_proto_reflection_library")
|
||
1 year ago
|
load(":defaults.bzl", "compile_edition_defaults", "embed_edition_defaults")
|
||
|
|
||
|
bzl_library(
|
||
|
name = "defaults",
|
||
|
srcs = ["defaults.bzl"],
|
||
|
visibility = ["//visibility:public"],
|
||
|
)
|
||
|
|
||
|
compile_edition_defaults(
|
||
|
name = "test_defaults_2023",
|
||
|
testonly = True,
|
||
|
srcs = ["//src/google/protobuf:unittest_features_proto"],
|
||
|
maximum_edition = "2023",
|
||
|
minimum_edition = "2023",
|
||
|
)
|
||
|
|
||
|
compile_edition_defaults(
|
||
|
name = "test_defaults_future",
|
||
|
testonly = True,
|
||
|
srcs = ["//src/google/protobuf:unittest_features_proto"],
|
||
|
maximum_edition = "99997_TEST_ONLY",
|
||
|
minimum_edition = "2023",
|
||
|
)
|
||
|
|
||
|
compile_edition_defaults(
|
||
|
name = "test_defaults_far_future",
|
||
|
testonly = True,
|
||
|
srcs = ["//src/google/protobuf:unittest_features_proto"],
|
||
|
maximum_edition = "99999_TEST_ONLY",
|
||
|
minimum_edition = "99997_TEST_ONLY",
|
||
|
)
|
||
|
|
||
|
embed_edition_defaults(
|
||
|
name = "embed_test_defaults",
|
||
|
testonly = True,
|
||
|
defaults = ":test_defaults_2023",
|
||
|
output = "defaults_test_embedded.h",
|
||
|
placeholder = "DEFAULTS_VALUE",
|
||
|
template = "defaults_test_embedded.h.template",
|
||
|
)
|
||
|
|
||
1 year ago
|
embed_edition_defaults(
|
||
|
name = "embed_test_defaults_base64",
|
||
|
testonly = True,
|
||
|
defaults = ":test_defaults_2023",
|
||
|
encoding = "base64",
|
||
|
output = "defaults_test_embedded_base64.h",
|
||
|
placeholder = "DEFAULTS_VALUE",
|
||
|
template = "defaults_test_embedded_base64.h.template",
|
||
|
)
|
||
|
|
||
1 year ago
|
cc_binary(
|
||
|
name = "internal_defaults_escape",
|
||
|
srcs = ["internal_defaults_escape.cc"],
|
||
|
# This needs to be public for users of embed_edition_defaults.
|
||
|
visibility = ["//visibility:public"],
|
||
|
deps = [
|
||
|
"//src/google/protobuf",
|
||
1 year ago
|
"@com_google_absl//absl/flags:flag",
|
||
|
"@com_google_absl//absl/flags:parse",
|
||
|
"@com_google_absl//absl/log:absl_log",
|
||
1 year ago
|
"@com_google_absl//absl/strings",
|
||
|
],
|
||
|
)
|
||
|
|
||
|
cc_library(
|
||
|
name = "defaults_test_embedded",
|
||
|
hdrs = [
|
||
|
"defaults_test_embedded.h",
|
||
1 year ago
|
"defaults_test_embedded_base64.h",
|
||
1 year ago
|
],
|
||
|
)
|
||
|
|
||
|
cc_test(
|
||
|
name = "defaults_test",
|
||
|
srcs = ["defaults_test.cc"],
|
||
|
data = [
|
||
|
":test_defaults_2023",
|
||
|
":test_defaults_far_future",
|
||
|
":test_defaults_future",
|
||
|
],
|
||
|
deps = [
|
||
|
":defaults_test_embedded",
|
||
|
"//src/google/protobuf",
|
||
1 year ago
|
"//src/google/protobuf:port",
|
||
1 year ago
|
"//src/google/protobuf:unittest_features_cc_proto",
|
||
|
"//src/google/protobuf/stubs",
|
||
|
"//src/google/protobuf/testing",
|
||
1 year ago
|
"//src/google/protobuf/testing:file",
|
||
1 year ago
|
"@bazel_tools//tools/cpp/runfiles",
|
||
|
"@com_google_absl//absl/memory",
|
||
|
"@com_google_absl//absl/status",
|
||
|
"@com_google_absl//absl/status:statusor",
|
||
|
"@com_google_absl//absl/strings",
|
||
|
"@com_google_absl//absl/strings:string_view",
|
||
1 year ago
|
"@com_google_googletest//:gtest",
|
||
1 year ago
|
"@com_google_googletest//:gtest_main",
|
||
|
],
|
||
|
)
|
||
2 years ago
|
|
||
|
proto_library(
|
||
1 year ago
|
name = "test_messages_proto2_editions_proto",
|
||
2 years ago
|
testonly = True,
|
||
1 year ago
|
srcs = ["golden/test_messages_proto2_editions.proto"],
|
||
2 years ago
|
)
|
||
|
|
||
2 years ago
|
cc_proto_library(
|
||
1 year ago
|
name = "test_messages_proto2_editions_cc_proto",
|
||
2 years ago
|
testonly = True,
|
||
1 year ago
|
visibility = ["//conformance:__pkg__"],
|
||
|
deps = [":test_messages_proto2_editions_proto"],
|
||
2 years ago
|
)
|
||
|
|
||
1 year ago
|
internal_objc_proto_library(
|
||
|
name = "test_messages_proto2_editions_objc_proto",
|
||
|
testonly = True,
|
||
|
srcs = ["golden/test_messages_proto2_editions.proto"],
|
||
|
visibility = ["//conformance:__pkg__"],
|
||
|
)
|
||
|
|
||
1 year ago
|
java_proto_library(
|
||
|
name = "test_messages_proto2_editions_java_proto",
|
||
|
testonly = True,
|
||
|
visibility = ["//conformance:__pkg__"],
|
||
|
deps = [":test_messages_proto2_editions_proto"],
|
||
|
)
|
||
|
|
||
11 months ago
|
java_lite_proto_library(
|
||
|
name = "test_messages_proto2_editions_java_proto_lite",
|
||
|
testonly = True,
|
||
|
visibility = ["//conformance:__pkg__"],
|
||
|
deps = [":test_messages_proto2_editions_proto"],
|
||
|
)
|
||
|
|
||
10 months ago
|
internal_py_proto_library(
|
||
1 year ago
|
name = "test_messages_proto2_editions_py_pb2",
|
||
|
testonly = True,
|
||
10 months ago
|
srcs = ["golden/test_messages_proto2_editions.proto"],
|
||
|
srcs_version = "PY2AND3",
|
||
|
visibility = [
|
||
|
"//conformance:__pkg__",
|
||
|
],
|
||
1 year ago
|
)
|
||
|
|
||
1 year ago
|
upb_c_proto_library(
|
||
|
name = "test_messages_proto2_editions_upb_proto",
|
||
|
testonly = 1,
|
||
|
deps = [":test_messages_proto2_editions_proto"],
|
||
|
)
|
||
|
|
||
|
upb_proto_reflection_library(
|
||
|
name = "test_messages_proto2_editions_upbdefs",
|
||
|
testonly = 1,
|
||
|
visibility = ["//upb/conformance:__pkg__"],
|
||
|
deps = [":test_messages_proto2_editions_proto"],
|
||
|
)
|
||
|
|
||
2 years ago
|
proto_library(
|
||
1 year ago
|
name = "test_messages_proto3_editions_proto",
|
||
2 years ago
|
testonly = True,
|
||
1 year ago
|
srcs = ["golden/test_messages_proto3_editions.proto"],
|
||
2 years ago
|
deps = [
|
||
|
"//:any_proto",
|
||
|
"//:duration_proto",
|
||
|
"//:field_mask_proto",
|
||
|
"//:struct_proto",
|
||
|
"//:timestamp_proto",
|
||
|
"//:wrappers_proto",
|
||
|
],
|
||
|
)
|
||
|
|
||
|
cc_proto_library(
|
||
1 year ago
|
name = "test_messages_proto3_editions_cc_proto",
|
||
2 years ago
|
testonly = True,
|
||
1 year ago
|
visibility = ["//conformance:__pkg__"],
|
||
|
deps = [":test_messages_proto3_editions_proto"],
|
||
2 years ago
|
)
|
||
|
|
||
1 year ago
|
internal_objc_proto_library(
|
||
|
name = "test_messages_proto3_editions_objc_proto",
|
||
|
testonly = True,
|
||
|
srcs = ["golden/test_messages_proto3_editions.proto"],
|
||
|
includes = [
|
||
|
".",
|
||
|
"src",
|
||
|
],
|
||
|
proto_deps = ["//:well_known_type_protos"],
|
||
|
visibility = ["//conformance:__pkg__"],
|
||
|
)
|
||
|
|
||
1 year ago
|
java_proto_library(
|
||
|
name = "test_messages_proto3_editions_java_proto",
|
||
|
testonly = True,
|
||
|
visibility = ["//conformance:__pkg__"],
|
||
|
deps = [":test_messages_proto3_editions_proto"],
|
||
|
)
|
||
|
|
||
11 months ago
|
java_lite_proto_library(
|
||
|
name = "test_messages_proto3_editions_java_proto_lite",
|
||
|
testonly = True,
|
||
|
visibility = ["//conformance:__pkg__"],
|
||
|
deps = [":test_messages_proto3_editions_proto"],
|
||
|
)
|
||
|
|
||
10 months ago
|
internal_py_proto_library(
|
||
1 year ago
|
name = "test_messages_proto3_editions_py_pb2",
|
||
|
testonly = True,
|
||
10 months ago
|
srcs = ["golden/test_messages_proto3_editions.proto"],
|
||
|
srcs_version = "PY2AND3",
|
||
|
visibility = [
|
||
|
"//conformance:__pkg__",
|
||
|
],
|
||
|
deps = ["//python:well_known_types_py_pb2"],
|
||
1 year ago
|
)
|
||
|
|
||
1 year ago
|
upb_c_proto_library(
|
||
|
name = "test_messages_proto3_editions_upb_proto",
|
||
|
testonly = 1,
|
||
|
deps = [":test_messages_proto3_editions_proto"],
|
||
|
)
|
||
|
|
||
|
upb_proto_reflection_library(
|
||
|
name = "test_messages_proto3_editions_upbdefs",
|
||
|
testonly = 1,
|
||
|
visibility = ["//upb/conformance:__pkg__"],
|
||
|
deps = ["test_messages_proto3_editions_proto"],
|
||
|
)
|
||
|
|
||
10 months ago
|
# Export these for conformance tests for ruby codegen.
|
||
1 year ago
|
exports_files(
|
||
|
[
|
||
|
"golden/test_messages_proto2_editions.proto",
|
||
|
"golden/test_messages_proto3_editions.proto",
|
||
|
],
|
||
|
visibility = [
|
||
11 months ago
|
"//ruby:__pkg__",
|
||
1 year ago
|
],
|
||
|
)
|
||
|
|
||
2 years ago
|
proto_library(
|
||
2 years ago
|
name = "test_editions_default_features_proto",
|
||
|
testonly = True,
|
||
|
srcs = ["proto/test_editions_default_features.proto"],
|
||
2 years ago
|
)
|
||
|
|
||
|
cc_proto_library(
|
||
2 years ago
|
name = "test_editions_default_features_cc_proto",
|
||
|
testonly = True,
|
||
|
deps = [":test_editions_default_features_proto"],
|
||
2 years ago
|
)
|
||
|
|
||
|
cc_test(
|
||
|
name = "generated_files_test",
|
||
|
srcs = ["generated_files_test.cc"],
|
||
|
deps = [
|
||
2 years ago
|
":test_editions_default_features_cc_proto",
|
||
1 year ago
|
":test_messages_proto2_editions_cc_proto",
|
||
|
":test_messages_proto3_editions_cc_proto",
|
||
1 year ago
|
"//:protobuf",
|
||
2 years ago
|
"//src/google/protobuf:test_textproto",
|
||
1 year ago
|
"@com_google_googletest//:gtest",
|
||
2 years ago
|
"@com_google_googletest//:gtest_main",
|
||
|
],
|
||
|
)
|
||
|
|
||
|
cc_test(
|
||
|
name = "generated_reflection_test",
|
||
|
srcs = ["generated_reflection_test.cc"],
|
||
|
deps = [
|
||
1 year ago
|
":test_messages_proto2_editions_cc_proto",
|
||
1 year ago
|
"@com_google_googletest//:gtest",
|
||
2 years ago
|
"@com_google_googletest//:gtest_main",
|
||
|
],
|
||
|
)
|
||
10 months ago
|
|
||
|
# Define a test suite to allow us to trigger these tests from //src expansions.
|
||
|
test_suite(name = "all_tests")
|