2017-12-01 11:05:32 +00:00
|
|
|
# Bazel (https://bazel.build/) BUILD file for Protobuf.
|
2015-06-18 00:37:58 +00:00
|
|
|
|
2020-03-02 23:15:22 +00:00
|
|
|
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
|
2022-05-13 02:48:58 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library", "cc_test")
|
2022-04-22 23:58:16 +00:00
|
|
|
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
2019-07-23 14:28:57 +00:00
|
|
|
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
|
2021-08-04 12:03:24 +00:00
|
|
|
load("@rules_java//java:defs.bzl", "java_binary", "java_lite_proto_library", "java_proto_library")
|
2022-05-06 19:11:46 +00:00
|
|
|
load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS")
|
2022-05-05 20:29:47 +00:00
|
|
|
load(
|
|
|
|
":protobuf.bzl",
|
|
|
|
"adapt_proto_library",
|
|
|
|
"py_proto_library",
|
|
|
|
)
|
2022-04-20 23:26:44 +00:00
|
|
|
|
2015-06-18 00:37:58 +00:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2016-08-04 22:32:14 +00:00
|
|
|
exports_files(["LICENSE"])
|
|
|
|
|
2015-06-28 22:23:02 +00:00
|
|
|
################################################################################
|
|
|
|
# Protobuf Runtime Library
|
|
|
|
################################################################################
|
|
|
|
|
2022-05-17 20:26:46 +00:00
|
|
|
cc_library(
|
|
|
|
name = "port_def",
|
|
|
|
hdrs = ["src/google/protobuf/port.h"],
|
|
|
|
includes = ["src"],
|
|
|
|
textual_hdrs = [
|
|
|
|
"src/google/protobuf/port_def.inc",
|
|
|
|
"src/google/protobuf/port_undef.inc",
|
|
|
|
],
|
|
|
|
visibility = ["//:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "arena",
|
|
|
|
srcs = [
|
|
|
|
"src/google/protobuf/arena.cc",
|
|
|
|
"src/google/protobuf/arena_impl.h",
|
|
|
|
"src/google/protobuf/arenaz_sampler.h",
|
|
|
|
],
|
|
|
|
hdrs = ["src/google/protobuf/arena.h"],
|
|
|
|
visibility = ["//:__subpackages__"],
|
|
|
|
deps = [
|
|
|
|
"//src/google/protobuf/stubs:lite",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-05-18 01:13:22 +00:00
|
|
|
# The "lite" runtime works for .proto files that specify the option:
|
|
|
|
# optimize_for = LITE_RUNTIME;
|
|
|
|
#
|
|
|
|
# The lite runtime does not include the `Reflection` APIs (including
|
|
|
|
# `Descriptor` and related types) or Well-Known Types.
|
|
|
|
#
|
|
|
|
# See also:
|
|
|
|
# https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#message
|
|
|
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf
|
2015-06-18 00:37:58 +00:00
|
|
|
cc_library(
|
|
|
|
name = "protobuf_lite",
|
|
|
|
srcs = [
|
|
|
|
# AUTOGEN(protobuf_lite_srcs)
|
2019-03-14 10:35:05 +00:00
|
|
|
"src/google/protobuf/any_lite.cc",
|
2020-09-28 19:19:39 +00:00
|
|
|
"src/google/protobuf/arenastring.cc",
|
2022-03-24 00:44:58 +00:00
|
|
|
"src/google/protobuf/arenaz_sampler.cc",
|
2015-06-18 00:37:58 +00:00
|
|
|
"src/google/protobuf/extension_set.cc",
|
2019-05-03 22:08:01 +00:00
|
|
|
"src/google/protobuf/generated_enum_util.cc",
|
2021-09-13 17:56:05 +00:00
|
|
|
"src/google/protobuf/generated_message_tctable_lite.cc",
|
2015-06-18 00:37:58 +00:00
|
|
|
"src/google/protobuf/generated_message_util.cc",
|
2017-12-07 22:16:50 +00:00
|
|
|
"src/google/protobuf/implicit_weak_message.cc",
|
2021-08-03 20:44:26 +00:00
|
|
|
"src/google/protobuf/inlined_string_field.cc",
|
2020-08-18 00:12:44 +00:00
|
|
|
"src/google/protobuf/map.cc",
|
2015-06-18 00:37:58 +00:00
|
|
|
"src/google/protobuf/message_lite.cc",
|
2019-03-14 10:35:05 +00:00
|
|
|
"src/google/protobuf/parse_context.cc",
|
2015-06-18 00:37:58 +00:00
|
|
|
"src/google/protobuf/repeated_field.cc",
|
2021-10-12 18:49:50 +00:00
|
|
|
"src/google/protobuf/repeated_ptr_field.cc",
|
2015-06-18 00:37:58 +00:00
|
|
|
"src/google/protobuf/wire_format_lite.cc",
|
|
|
|
],
|
2019-07-01 19:21:04 +00:00
|
|
|
hdrs = glob([
|
|
|
|
"src/google/protobuf/**/*.h",
|
|
|
|
"src/google/protobuf/**/*.inc",
|
|
|
|
]),
|
2017-10-15 20:06:58 +00:00
|
|
|
copts = COPTS,
|
2015-06-18 00:37:58 +00:00
|
|
|
includes = ["src/"],
|
|
|
|
linkopts = LINK_OPTS,
|
|
|
|
visibility = ["//visibility:public"],
|
2022-05-18 01:13:22 +00:00
|
|
|
# In Bazel 6.0+, these will be `interface_deps`:
|
2022-05-17 20:26:46 +00:00
|
|
|
deps = [
|
|
|
|
":arena",
|
|
|
|
"//src/google/protobuf/io",
|
|
|
|
"//src/google/protobuf/stubs:lite",
|
|
|
|
],
|
2015-06-18 00:37:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "protobuf",
|
2022-05-17 23:39:47 +00:00
|
|
|
hdrs = glob([
|
|
|
|
"src/**/*.h",
|
|
|
|
"src/**/*.inc",
|
|
|
|
]),
|
|
|
|
copts = COPTS,
|
|
|
|
includes = ["src/"],
|
|
|
|
linkopts = LINK_OPTS,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
":internal_protobuf_full",
|
2022-05-18 01:13:22 +00:00
|
|
|
# Other targets which depend on ':internal_protobuf_full':
|
2022-05-17 23:39:47 +00:00
|
|
|
"//src/google/protobuf/compiler:importer",
|
2022-05-18 01:13:22 +00:00
|
|
|
"//src/google/protobuf/util:delimited_message_util",
|
|
|
|
"//src/google/protobuf/util:differencer",
|
|
|
|
"//src/google/protobuf/util:field_mask_util",
|
|
|
|
"//src/google/protobuf/util:json_util",
|
|
|
|
"//src/google/protobuf/util:time_util",
|
|
|
|
"//src/google/protobuf/util:type_resolver_util",
|
2022-05-17 23:39:47 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# `:internal_protobuf_full` is an internal target which has the non-lite
|
|
|
|
# portions of the protobuf runtime.
|
|
|
|
#
|
|
|
|
# Users of the full runtime should depend upon `:protobuf` instead, which
|
|
|
|
# also includes the util library.
|
|
|
|
cc_library(
|
|
|
|
name = "internal_protobuf_full",
|
2015-06-18 00:37:58 +00:00
|
|
|
srcs = [
|
|
|
|
# AUTOGEN(protobuf_srcs)
|
|
|
|
"src/google/protobuf/any.cc",
|
|
|
|
"src/google/protobuf/any.pb.cc",
|
|
|
|
"src/google/protobuf/api.pb.cc",
|
|
|
|
"src/google/protobuf/descriptor.cc",
|
|
|
|
"src/google/protobuf/descriptor.pb.cc",
|
|
|
|
"src/google/protobuf/descriptor_database.cc",
|
|
|
|
"src/google/protobuf/duration.pb.cc",
|
|
|
|
"src/google/protobuf/dynamic_message.cc",
|
|
|
|
"src/google/protobuf/empty.pb.cc",
|
|
|
|
"src/google/protobuf/extension_set_heavy.cc",
|
|
|
|
"src/google/protobuf/field_mask.pb.cc",
|
2021-08-18 17:25:22 +00:00
|
|
|
"src/google/protobuf/generated_message_bases.cc",
|
2015-06-18 00:37:58 +00:00
|
|
|
"src/google/protobuf/generated_message_reflection.cc",
|
2021-09-13 17:56:05 +00:00
|
|
|
"src/google/protobuf/generated_message_tctable_full.cc",
|
2015-06-18 00:37:58 +00:00
|
|
|
"src/google/protobuf/map_field.cc",
|
|
|
|
"src/google/protobuf/message.cc",
|
|
|
|
"src/google/protobuf/reflection_ops.cc",
|
|
|
|
"src/google/protobuf/service.cc",
|
|
|
|
"src/google/protobuf/source_context.pb.cc",
|
|
|
|
"src/google/protobuf/struct.pb.cc",
|
|
|
|
"src/google/protobuf/text_format.cc",
|
|
|
|
"src/google/protobuf/timestamp.pb.cc",
|
|
|
|
"src/google/protobuf/type.pb.cc",
|
|
|
|
"src/google/protobuf/unknown_field_set.cc",
|
|
|
|
"src/google/protobuf/wire_format.cc",
|
|
|
|
"src/google/protobuf/wrappers.pb.cc",
|
|
|
|
],
|
2019-07-01 19:21:04 +00:00
|
|
|
hdrs = glob([
|
|
|
|
"src/**/*.h",
|
|
|
|
"src/**/*.inc",
|
|
|
|
]),
|
2017-10-15 20:06:58 +00:00
|
|
|
copts = COPTS,
|
2015-06-18 00:37:58 +00:00
|
|
|
includes = ["src/"],
|
|
|
|
linkopts = LINK_OPTS,
|
2022-05-17 23:39:47 +00:00
|
|
|
visibility = [
|
|
|
|
"//:__subpackages__", # this target is only to break circular deps
|
|
|
|
],
|
2022-05-17 20:26:46 +00:00
|
|
|
deps = [
|
|
|
|
":protobuf_lite",
|
|
|
|
"//src/google/protobuf/io",
|
|
|
|
"//src/google/protobuf/io:gzip_stream",
|
|
|
|
"//src/google/protobuf/io:printer",
|
|
|
|
"//src/google/protobuf/io:tokenizer",
|
|
|
|
"//src/google/protobuf/stubs",
|
|
|
|
],
|
2015-06-18 00:37:58 +00:00
|
|
|
)
|
|
|
|
|
2017-03-03 02:02:05 +00:00
|
|
|
# This provides just the header files for use in projects that need to build
|
|
|
|
# shared libraries for dynamic loading. This target is available until Bazel
|
|
|
|
# adds native support for such use cases.
|
|
|
|
# TODO(keveman): Remove this target once the support gets added to Bazel.
|
2017-02-23 16:17:24 +00:00
|
|
|
cc_library(
|
|
|
|
name = "protobuf_headers",
|
2019-07-01 19:21:04 +00:00
|
|
|
hdrs = glob([
|
|
|
|
"src/**/*.h",
|
|
|
|
"src/**/*.inc",
|
|
|
|
]),
|
2017-02-23 16:17:24 +00:00
|
|
|
includes = ["src/"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2022-05-05 20:29:47 +00:00
|
|
|
filegroup(
|
|
|
|
name = "well_known_type_protos",
|
|
|
|
srcs = [
|
|
|
|
"src/google/protobuf/any.proto",
|
2021-06-21 22:28:17 +00:00
|
|
|
"src/google/protobuf/api.proto",
|
2022-05-05 20:29:47 +00:00
|
|
|
"src/google/protobuf/duration.proto",
|
|
|
|
"src/google/protobuf/empty.proto",
|
|
|
|
"src/google/protobuf/field_mask.proto",
|
|
|
|
"src/google/protobuf/source_context.proto",
|
|
|
|
"src/google/protobuf/struct.proto",
|
|
|
|
"src/google/protobuf/timestamp.proto",
|
2021-06-21 22:28:17 +00:00
|
|
|
"src/google/protobuf/type.proto",
|
2022-05-05 20:29:47 +00:00
|
|
|
"src/google/protobuf/wrappers.proto",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2021-06-21 22:28:17 +00:00
|
|
|
|
2016-03-23 00:56:07 +00:00
|
|
|
filegroup(
|
2022-05-05 20:29:47 +00:00
|
|
|
name = "built_in_runtime_protos",
|
2022-05-17 23:39:47 +00:00
|
|
|
srcs = ["src/google/protobuf/descriptor.proto"],
|
2022-05-05 20:29:47 +00:00
|
|
|
visibility = ["//:__subpackages__"],
|
2016-03-23 00:56:07 +00:00
|
|
|
)
|
|
|
|
|
2022-04-20 23:26:44 +00:00
|
|
|
exports_files(
|
2022-05-05 20:29:47 +00:00
|
|
|
srcs = [
|
|
|
|
"src/google/protobuf/any.proto",
|
|
|
|
"src/google/protobuf/api.proto",
|
|
|
|
"src/google/protobuf/duration.proto",
|
|
|
|
"src/google/protobuf/empty.proto",
|
|
|
|
"src/google/protobuf/field_mask.proto",
|
|
|
|
"src/google/protobuf/source_context.proto",
|
|
|
|
"src/google/protobuf/struct.proto",
|
|
|
|
"src/google/protobuf/timestamp.proto",
|
|
|
|
"src/google/protobuf/type.proto",
|
|
|
|
"src/google/protobuf/wrappers.proto",
|
|
|
|
],
|
2022-04-20 23:26:44 +00:00
|
|
|
visibility = ["//pkg:__pkg__"],
|
|
|
|
)
|
|
|
|
|
2022-05-05 20:29:47 +00:00
|
|
|
alias(
|
2021-06-21 22:28:17 +00:00
|
|
|
name = "lite_well_known_protos",
|
2022-05-05 20:29:47 +00:00
|
|
|
actual = ":well_known_type_protos",
|
2021-06-21 22:28:17 +00:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2020-02-15 12:26:56 +00:00
|
|
|
adapt_proto_library(
|
|
|
|
name = "cc_wkt_protos_genproto",
|
|
|
|
visibility = ["//visibility:public"],
|
2022-05-05 20:29:47 +00:00
|
|
|
deps = [
|
|
|
|
"//:any_proto",
|
|
|
|
"//:api_proto",
|
|
|
|
"//:compiler_plugin_proto",
|
|
|
|
"//:descriptor_proto",
|
|
|
|
"//:duration_proto",
|
|
|
|
"//:empty_proto",
|
|
|
|
"//:field_mask_proto",
|
|
|
|
"//:source_context_proto",
|
|
|
|
"//:struct_proto",
|
|
|
|
"//:timestamp_proto",
|
|
|
|
"//:type_proto",
|
|
|
|
"//:wrappers_proto",
|
|
|
|
],
|
2020-02-15 12:26:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
2015-10-15 00:12:11 +00:00
|
|
|
name = "cc_wkt_protos",
|
2020-02-15 12:26:56 +00:00
|
|
|
deprecation = "Only for backward compatibility. Do not use.",
|
2015-11-17 20:36:21 +00:00
|
|
|
visibility = ["//visibility:public"],
|
2015-10-15 00:12:11 +00:00
|
|
|
)
|
|
|
|
|
2017-09-05 15:15:10 +00:00
|
|
|
################################################################################
|
|
|
|
# Well Known Types Proto Library Rules
|
|
|
|
#
|
2022-05-05 20:29:47 +00:00
|
|
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf
|
|
|
|
################################################################################
|
2017-09-05 15:15:10 +00:00
|
|
|
# These proto_library rules can be used with one of the language specific proto
|
|
|
|
# library rules i.e. java_proto_library:
|
|
|
|
#
|
|
|
|
# java_proto_library(
|
|
|
|
# name = "any_java_proto",
|
|
|
|
# deps = ["@com_google_protobuf//:any_proto],
|
|
|
|
# )
|
|
|
|
################################################################################
|
|
|
|
|
2022-05-05 20:29:47 +00:00
|
|
|
proto_library(
|
|
|
|
name = "any_proto",
|
|
|
|
srcs = ["src/google/protobuf/any.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "api_proto",
|
|
|
|
srcs = ["src/google/protobuf/api.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//:source_context_proto",
|
|
|
|
"//:type_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "duration_proto",
|
|
|
|
srcs = ["//:src/google/protobuf/duration.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "empty_proto",
|
|
|
|
srcs = ["src/google/protobuf/empty.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "field_mask_proto",
|
|
|
|
srcs = ["src/google/protobuf/field_mask.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "source_context_proto",
|
|
|
|
srcs = ["src/google/protobuf/source_context.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "struct_proto",
|
|
|
|
srcs = ["src/google/protobuf/struct.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "timestamp_proto",
|
|
|
|
srcs = ["src/google/protobuf/timestamp.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "type_proto",
|
|
|
|
srcs = ["src/google/protobuf/type.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//:any_proto",
|
|
|
|
"//:source_context_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "wrappers_proto",
|
|
|
|
srcs = ["src/google/protobuf/wrappers.proto"],
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Built-in runtime types
|
|
|
|
|
2022-05-17 23:39:47 +00:00
|
|
|
alias(
|
2022-05-05 20:29:47 +00:00
|
|
|
name = "compiler_plugin_proto",
|
2022-05-17 23:39:47 +00:00
|
|
|
actual = "//src/google/protobuf/compiler:plugin_proto",
|
2022-05-05 20:29:47 +00:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "descriptor_proto",
|
|
|
|
srcs = ["src/google/protobuf/descriptor.proto"],
|
2019-07-18 13:55:47 +00:00
|
|
|
strip_import_prefix = "src",
|
2017-09-05 15:15:10 +00:00
|
|
|
visibility = ["//visibility:public"],
|
2022-05-05 20:29:47 +00:00
|
|
|
)
|
|
|
|
|
2015-06-28 22:23:02 +00:00
|
|
|
################################################################################
|
|
|
|
# Protocol Buffers Compiler
|
|
|
|
################################################################################
|
|
|
|
|
2015-06-18 00:37:58 +00:00
|
|
|
cc_binary(
|
|
|
|
name = "protoc",
|
|
|
|
linkopts = LINK_OPTS,
|
|
|
|
visibility = ["//visibility:public"],
|
2022-05-17 23:39:47 +00:00
|
|
|
deps = ["//src/google/protobuf/compiler:protoc_lib"],
|
2015-06-18 00:37:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Tests
|
|
|
|
################################################################################
|
|
|
|
|
2021-04-20 18:36:32 +00:00
|
|
|
filegroup(
|
|
|
|
name = "testdata",
|
2022-05-17 20:26:46 +00:00
|
|
|
srcs = glob(["src/google/protobuf/testdata/**/*"]) + [
|
|
|
|
"src/google/protobuf/descriptor.cc",
|
|
|
|
],
|
2022-04-25 22:00:57 +00:00
|
|
|
visibility = [
|
|
|
|
"//:__subpackages__",
|
|
|
|
"@upb//:__subpackages__",
|
|
|
|
],
|
2021-04-20 18:36:32 +00:00
|
|
|
)
|
|
|
|
|
2015-10-20 00:19:49 +00:00
|
|
|
RELATIVE_LITE_TEST_PROTOS = [
|
2015-06-18 00:37:58 +00:00
|
|
|
# AUTOGEN(lite_test_protos)
|
|
|
|
"google/protobuf/map_lite_unittest.proto",
|
|
|
|
"google/protobuf/unittest_import_lite.proto",
|
|
|
|
"google/protobuf/unittest_import_public_lite.proto",
|
|
|
|
"google/protobuf/unittest_lite.proto",
|
|
|
|
]
|
|
|
|
|
2015-10-20 00:19:49 +00:00
|
|
|
LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS]
|
|
|
|
|
2022-05-11 23:45:17 +00:00
|
|
|
proto_library(
|
|
|
|
name = "lite_test_protos",
|
|
|
|
srcs = LITE_TEST_PROTOS,
|
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//:__subpackages__"],
|
|
|
|
deps = [
|
|
|
|
"//:any_proto",
|
|
|
|
"//:api_proto",
|
|
|
|
"//:descriptor_proto",
|
|
|
|
"//:duration_proto",
|
|
|
|
"//:empty_proto",
|
|
|
|
"//:field_mask_proto",
|
|
|
|
"//:source_context_proto",
|
|
|
|
"//:struct_proto",
|
|
|
|
"//:timestamp_proto",
|
|
|
|
"//:type_proto",
|
|
|
|
"//:wrappers_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2015-10-20 00:19:49 +00:00
|
|
|
RELATIVE_TEST_PROTOS = [
|
2015-06-18 00:37:58 +00:00
|
|
|
# AUTOGEN(test_protos)
|
|
|
|
"google/protobuf/any_test.proto",
|
|
|
|
"google/protobuf/map_proto2_unittest.proto",
|
|
|
|
"google/protobuf/map_unittest.proto",
|
|
|
|
"google/protobuf/unittest.proto",
|
|
|
|
"google/protobuf/unittest_arena.proto",
|
|
|
|
"google/protobuf/unittest_custom_options.proto",
|
|
|
|
"google/protobuf/unittest_drop_unknown_fields.proto",
|
|
|
|
"google/protobuf/unittest_embed_optimize_for.proto",
|
|
|
|
"google/protobuf/unittest_empty.proto",
|
|
|
|
"google/protobuf/unittest_enormous_descriptor.proto",
|
|
|
|
"google/protobuf/unittest_import.proto",
|
|
|
|
"google/protobuf/unittest_import_public.proto",
|
2017-03-29 21:01:40 +00:00
|
|
|
"google/protobuf/unittest_lazy_dependencies.proto",
|
|
|
|
"google/protobuf/unittest_lazy_dependencies_custom_option.proto",
|
|
|
|
"google/protobuf/unittest_lazy_dependencies_enum.proto",
|
2015-06-18 00:37:58 +00:00
|
|
|
"google/protobuf/unittest_lite_imports_nonlite.proto",
|
|
|
|
"google/protobuf/unittest_mset.proto",
|
2015-08-26 00:06:33 +00:00
|
|
|
"google/protobuf/unittest_mset_wire_format.proto",
|
2015-06-18 00:37:58 +00:00
|
|
|
"google/protobuf/unittest_no_field_presence.proto",
|
|
|
|
"google/protobuf/unittest_no_generic_services.proto",
|
|
|
|
"google/protobuf/unittest_optimize_for.proto",
|
|
|
|
"google/protobuf/unittest_preserve_unknown_enum.proto",
|
|
|
|
"google/protobuf/unittest_preserve_unknown_enum2.proto",
|
2018-08-13 19:58:55 +00:00
|
|
|
"google/protobuf/unittest_proto3.proto",
|
2015-06-18 00:37:58 +00:00
|
|
|
"google/protobuf/unittest_proto3_arena.proto",
|
2016-04-15 16:23:50 +00:00
|
|
|
"google/protobuf/unittest_proto3_arena_lite.proto",
|
|
|
|
"google/protobuf/unittest_proto3_lite.proto",
|
2020-04-01 00:31:32 +00:00
|
|
|
"google/protobuf/unittest_proto3_optional.proto",
|
2015-06-18 00:37:58 +00:00
|
|
|
"google/protobuf/unittest_well_known_types.proto",
|
|
|
|
]
|
|
|
|
|
2015-10-20 00:19:49 +00:00
|
|
|
TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS]
|
|
|
|
|
2022-05-13 02:48:58 +00:00
|
|
|
filegroup(
|
|
|
|
name = "test_proto_srcs",
|
|
|
|
srcs = TEST_PROTOS,
|
|
|
|
visibility = ["//:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2022-05-11 23:45:17 +00:00
|
|
|
proto_library(
|
|
|
|
name = "test_protos",
|
2022-05-13 02:48:58 +00:00
|
|
|
srcs = [":test_proto_srcs"],
|
2022-05-11 23:45:17 +00:00
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//:__subpackages__"],
|
|
|
|
deps = [
|
|
|
|
"//:any_proto",
|
|
|
|
"//:api_proto",
|
|
|
|
"//:descriptor_proto",
|
|
|
|
"//:duration_proto",
|
|
|
|
"//:empty_proto",
|
|
|
|
"//:field_mask_proto",
|
|
|
|
"//:source_context_proto",
|
|
|
|
"//:struct_proto",
|
|
|
|
"//:timestamp_proto",
|
|
|
|
"//:type_proto",
|
|
|
|
"//:wrappers_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-04-20 18:36:32 +00:00
|
|
|
GENERIC_RELATIVE_TEST_PROTOS = [
|
2022-02-01 18:24:53 +00:00
|
|
|
"google/protobuf/map_proto2_unittest.proto",
|
|
|
|
"google/protobuf/map_unittest.proto",
|
2021-04-20 18:36:32 +00:00
|
|
|
"google/protobuf/unittest.proto",
|
|
|
|
"google/protobuf/unittest_arena.proto",
|
|
|
|
"google/protobuf/unittest_custom_options.proto",
|
|
|
|
"google/protobuf/unittest_drop_unknown_fields.proto",
|
|
|
|
"google/protobuf/unittest_embed_optimize_for.proto",
|
|
|
|
"google/protobuf/unittest_empty.proto",
|
|
|
|
"google/protobuf/unittest_enormous_descriptor.proto",
|
|
|
|
"google/protobuf/unittest_import.proto",
|
|
|
|
"google/protobuf/unittest_import_public.proto",
|
|
|
|
"google/protobuf/unittest_lazy_dependencies.proto",
|
|
|
|
"google/protobuf/unittest_lazy_dependencies_custom_option.proto",
|
|
|
|
"google/protobuf/unittest_lazy_dependencies_enum.proto",
|
|
|
|
"google/protobuf/unittest_lite_imports_nonlite.proto",
|
|
|
|
"google/protobuf/unittest_mset.proto",
|
|
|
|
"google/protobuf/unittest_mset_wire_format.proto",
|
|
|
|
"google/protobuf/unittest_no_field_presence.proto",
|
|
|
|
"google/protobuf/unittest_no_generic_services.proto",
|
|
|
|
"google/protobuf/unittest_optimize_for.proto",
|
|
|
|
"google/protobuf/unittest_preserve_unknown_enum.proto",
|
|
|
|
"google/protobuf/unittest_preserve_unknown_enum2.proto",
|
|
|
|
"google/protobuf/unittest_proto3.proto",
|
|
|
|
"google/protobuf/unittest_proto3_arena.proto",
|
|
|
|
"google/protobuf/unittest_proto3_arena_lite.proto",
|
|
|
|
"google/protobuf/unittest_proto3_lite.proto",
|
|
|
|
"google/protobuf/unittest_proto3_optional.proto",
|
|
|
|
"google/protobuf/unittest_well_known_types.proto",
|
|
|
|
]
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "generic_test_protos",
|
2022-05-11 23:45:17 +00:00
|
|
|
srcs = ["src/" + s for s in GENERIC_RELATIVE_TEST_PROTOS],
|
2021-08-04 12:03:24 +00:00
|
|
|
strip_import_prefix = "src",
|
|
|
|
visibility = ["//:__subpackages__"],
|
2021-04-20 18:36:32 +00:00
|
|
|
deps = [
|
|
|
|
"//:any_proto",
|
|
|
|
"//:api_proto",
|
|
|
|
"//:descriptor_proto",
|
|
|
|
"//:duration_proto",
|
|
|
|
"//:empty_proto",
|
|
|
|
"//:field_mask_proto",
|
|
|
|
"//:source_context_proto",
|
|
|
|
"//:struct_proto",
|
|
|
|
"//:timestamp_proto",
|
|
|
|
"//:type_proto",
|
|
|
|
"//:wrappers_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-05-11 23:45:17 +00:00
|
|
|
cc_proto_library(
|
|
|
|
name = "cc_lite_test_protos",
|
|
|
|
deps = [":lite_test_protos"],
|
|
|
|
)
|
|
|
|
|
2015-10-15 00:12:11 +00:00
|
|
|
cc_proto_library(
|
|
|
|
name = "cc_test_protos",
|
2022-05-18 01:13:22 +00:00
|
|
|
visibility = ["//:__subpackages__"],
|
2022-05-11 23:45:17 +00:00
|
|
|
deps = [":test_protos"],
|
2015-06-18 00:37:58 +00:00
|
|
|
)
|
|
|
|
|
2022-05-17 23:39:47 +00:00
|
|
|
filegroup(
|
|
|
|
name = "descriptor_cc_srcs",
|
|
|
|
testonly = 1,
|
|
|
|
data = [
|
|
|
|
"src/google/protobuf/descriptor.pb.cc",
|
|
|
|
"src/google/protobuf/descriptor.pb.h",
|
|
|
|
],
|
|
|
|
visibility = ["//src/google/protobuf/compiler/cpp:__pkg__"],
|
|
|
|
)
|
2015-06-18 00:37:58 +00:00
|
|
|
|
2022-05-17 23:39:47 +00:00
|
|
|
cc_library(
|
|
|
|
name = "test_util",
|
|
|
|
testonly = 1,
|
2015-06-18 23:45:27 +00:00
|
|
|
srcs = [
|
2022-05-17 23:39:47 +00:00
|
|
|
"src/google/protobuf/arena_test_util.cc",
|
|
|
|
"src/google/protobuf/map_lite_test_util.cc",
|
|
|
|
"src/google/protobuf/reflection_tester.cc",
|
|
|
|
"src/google/protobuf/test_util.cc",
|
|
|
|
"src/google/protobuf/test_util_lite.cc",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"src/google/protobuf/arena_test_util.h",
|
|
|
|
"src/google/protobuf/map_lite_test_util.h",
|
|
|
|
"src/google/protobuf/map_test_util.h",
|
|
|
|
"src/google/protobuf/map_test_util_impl.h",
|
|
|
|
"src/google/protobuf/test_util.h",
|
|
|
|
"src/google/protobuf/test_util2.h",
|
|
|
|
"src/google/protobuf/test_util_lite.h",
|
2015-06-18 23:45:27 +00:00
|
|
|
],
|
2022-05-17 20:26:46 +00:00
|
|
|
copts = COPTS,
|
2022-05-17 23:39:47 +00:00
|
|
|
includes = ["src"],
|
|
|
|
textual_hdrs = [
|
|
|
|
"src/google/protobuf/map_test_util.inc",
|
|
|
|
"src/google/protobuf/test_util.inc",
|
|
|
|
],
|
|
|
|
visibility = ["//:__subpackages__"],
|
2015-06-18 23:45:27 +00:00
|
|
|
deps = [
|
2022-05-17 23:39:47 +00:00
|
|
|
":cc_lite_test_protos",
|
|
|
|
":cc_test_protos",
|
2021-03-10 09:20:39 +00:00
|
|
|
"@com_google_googletest//:gtest",
|
|
|
|
],
|
2015-06-18 23:45:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "protobuf_test",
|
2022-05-17 23:39:47 +00:00
|
|
|
srcs = [
|
2015-06-18 23:45:27 +00:00
|
|
|
# AUTOGEN(test_srcs)
|
|
|
|
"src/google/protobuf/any_test.cc",
|
|
|
|
"src/google/protobuf/arena_unittest.cc",
|
|
|
|
"src/google/protobuf/arenastring_unittest.cc",
|
2022-03-24 00:44:58 +00:00
|
|
|
"src/google/protobuf/arenaz_sampler_test.cc",
|
2015-06-18 23:45:27 +00:00
|
|
|
"src/google/protobuf/descriptor_database_unittest.cc",
|
|
|
|
"src/google/protobuf/descriptor_unittest.cc",
|
|
|
|
"src/google/protobuf/drop_unknown_fields_test.cc",
|
|
|
|
"src/google/protobuf/dynamic_message_unittest.cc",
|
|
|
|
"src/google/protobuf/extension_set_unittest.cc",
|
|
|
|
"src/google/protobuf/generated_message_reflection_unittest.cc",
|
2022-03-24 00:44:58 +00:00
|
|
|
"src/google/protobuf/generated_message_tctable_lite_test.cc",
|
2021-08-03 20:44:26 +00:00
|
|
|
"src/google/protobuf/inlined_string_field_unittest.cc",
|
2015-06-18 23:45:27 +00:00
|
|
|
"src/google/protobuf/map_field_test.cc",
|
|
|
|
"src/google/protobuf/map_test.cc",
|
2021-08-03 21:13:43 +00:00
|
|
|
"src/google/protobuf/map_test.inc",
|
2015-06-18 23:45:27 +00:00
|
|
|
"src/google/protobuf/message_unittest.cc",
|
2018-03-23 17:19:04 +00:00
|
|
|
"src/google/protobuf/message_unittest.inc",
|
2015-06-18 23:45:27 +00:00
|
|
|
"src/google/protobuf/no_field_presence_test.cc",
|
|
|
|
"src/google/protobuf/preserve_unknown_enum_test.cc",
|
2016-04-15 16:23:50 +00:00
|
|
|
"src/google/protobuf/proto3_arena_lite_unittest.cc",
|
2016-04-28 21:43:22 +00:00
|
|
|
"src/google/protobuf/proto3_arena_unittest.cc",
|
2016-04-15 16:23:50 +00:00
|
|
|
"src/google/protobuf/proto3_lite_unittest.cc",
|
2018-08-13 19:58:55 +00:00
|
|
|
"src/google/protobuf/proto3_lite_unittest.inc",
|
2015-06-18 23:45:27 +00:00
|
|
|
"src/google/protobuf/reflection_ops_unittest.cc",
|
|
|
|
"src/google/protobuf/repeated_field_reflection_unittest.cc",
|
|
|
|
"src/google/protobuf/repeated_field_unittest.cc",
|
|
|
|
"src/google/protobuf/text_format_unittest.cc",
|
|
|
|
"src/google/protobuf/unknown_field_set_unittest.cc",
|
|
|
|
"src/google/protobuf/well_known_types_unittest.cc",
|
|
|
|
"src/google/protobuf/wire_format_unittest.cc",
|
2021-08-03 20:44:26 +00:00
|
|
|
"src/google/protobuf/wire_format_unittest.inc",
|
2022-05-06 19:11:46 +00:00
|
|
|
],
|
2021-08-04 13:10:22 +00:00
|
|
|
copts = COPTS + select({
|
2022-05-06 19:11:46 +00:00
|
|
|
"//build_defs:config_msvc": [],
|
2021-08-04 13:10:22 +00:00
|
|
|
"//conditions:default": [
|
|
|
|
"-Wno-deprecated-declarations",
|
|
|
|
],
|
|
|
|
}),
|
2015-06-18 23:45:27 +00:00
|
|
|
data = [
|
2022-05-17 20:26:46 +00:00
|
|
|
":testdata",
|
2015-10-21 18:19:16 +00:00
|
|
|
] + glob([
|
|
|
|
"src/google/protobuf/**/*",
|
2022-05-05 00:30:23 +00:00
|
|
|
]) + glob(
|
|
|
|
[
|
|
|
|
# Files for csharp_bootstrap_unittest.cc.
|
|
|
|
"csharp/src/**/*",
|
|
|
|
],
|
|
|
|
allow_empty = True,
|
|
|
|
),
|
2015-06-18 23:45:27 +00:00
|
|
|
includes = [
|
|
|
|
"src/",
|
|
|
|
],
|
|
|
|
linkopts = LINK_OPTS,
|
|
|
|
deps = [
|
2022-05-11 23:45:17 +00:00
|
|
|
":cc_lite_test_protos",
|
2015-10-20 00:19:49 +00:00
|
|
|
":cc_test_protos",
|
2015-06-18 23:45:27 +00:00
|
|
|
":protobuf",
|
2022-05-17 23:39:47 +00:00
|
|
|
":test_util",
|
2022-05-17 20:26:46 +00:00
|
|
|
"//src/google/protobuf/testing",
|
2021-03-10 09:20:39 +00:00
|
|
|
"@com_google_googletest//:gtest",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
2022-05-17 20:26:46 +00:00
|
|
|
],
|
2015-06-18 23:45:27 +00:00
|
|
|
)
|
2015-10-20 00:19:49 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Java support
|
|
|
|
################################################################################
|
2020-02-13 21:04:14 +00:00
|
|
|
|
|
|
|
alias(
|
2015-10-21 17:56:38 +00:00
|
|
|
name = "protobuf_java",
|
2020-02-13 21:04:14 +00:00
|
|
|
actual = "//java/core",
|
2015-10-20 00:19:49 +00:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2020-02-13 21:04:14 +00:00
|
|
|
alias(
|
2019-05-24 14:26:07 +00:00
|
|
|
name = "protobuf_javalite",
|
2020-02-13 21:04:14 +00:00
|
|
|
actual = "//java/lite",
|
2015-10-20 00:19:49 +00:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2020-02-13 21:04:14 +00:00
|
|
|
alias(
|
2016-03-11 01:50:25 +00:00
|
|
|
name = "protobuf_java_util",
|
2020-02-13 21:04:14 +00:00
|
|
|
actual = "//java/util",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
alias(
|
|
|
|
name = "java_toolchain",
|
|
|
|
actual = "//java/core:toolchain",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
alias(
|
|
|
|
name = "javalite_toolchain",
|
|
|
|
actual = "//java/lite:toolchain",
|
2017-02-23 16:17:24 +00:00
|
|
|
visibility = ["//visibility:public"],
|
2016-03-11 01:50:25 +00:00
|
|
|
)
|
|
|
|
|
2015-10-20 00:19:49 +00:00
|
|
|
################################################################################
|
|
|
|
# Python support
|
|
|
|
################################################################################
|
|
|
|
|
2022-05-13 02:48:58 +00:00
|
|
|
alias(
|
|
|
|
name = "protobuf_python",
|
|
|
|
actual = "//python:protobuf_python",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
alias(
|
2015-10-20 00:19:49 +00:00
|
|
|
name = "python_srcs",
|
2022-05-13 02:48:58 +00:00
|
|
|
actual = "//python:python_srcs",
|
2022-04-25 22:00:57 +00:00
|
|
|
visibility = ["@upb//:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2022-05-13 02:48:58 +00:00
|
|
|
alias(
|
2022-04-25 22:00:57 +00:00
|
|
|
name = "python_test_srcs",
|
2022-05-13 02:48:58 +00:00
|
|
|
actual = "//python:python_test_srcs",
|
2022-04-25 22:00:57 +00:00
|
|
|
visibility = ["@upb//:__subpackages__"],
|
2015-10-20 00:19:49 +00:00
|
|
|
)
|
|
|
|
|
2022-05-13 02:48:58 +00:00
|
|
|
alias(
|
2022-04-25 22:00:57 +00:00
|
|
|
name = "well_known_types_py_pb2",
|
2022-05-13 02:48:58 +00:00
|
|
|
actual = "//python:well_known_types_py_pb2",
|
2022-04-25 22:00:57 +00:00
|
|
|
visibility = ["@upb//:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2022-05-13 02:48:58 +00:00
|
|
|
alias(
|
2015-10-20 00:19:49 +00:00
|
|
|
name = "python_common_test_protos",
|
2022-05-13 02:48:58 +00:00
|
|
|
actual = "//python:python_common_test_protos",
|
2022-04-25 22:00:57 +00:00
|
|
|
visibility = ["//visibility:public"],
|
2015-10-20 00:19:49 +00:00
|
|
|
)
|
|
|
|
|
2022-05-13 02:48:58 +00:00
|
|
|
alias(
|
2015-10-20 00:19:49 +00:00
|
|
|
name = "python_specific_test_protos",
|
2022-05-13 02:48:58 +00:00
|
|
|
actual = "//python:python_specific_test_protos",
|
2022-04-25 22:00:57 +00:00
|
|
|
visibility = ["//visibility:public"],
|
2018-05-29 22:26:11 +00:00
|
|
|
)
|
|
|
|
|
2016-12-03 00:40:50 +00:00
|
|
|
proto_lang_toolchain(
|
2017-02-23 16:17:24 +00:00
|
|
|
name = "cc_toolchain",
|
2022-05-05 20:29:47 +00:00
|
|
|
blacklisted_protos = [
|
2022-05-06 19:11:46 +00:00
|
|
|
"@com_google_protobuf//:any_proto",
|
|
|
|
"@com_google_protobuf//:api_proto",
|
|
|
|
"@com_google_protobuf//:compiler_plugin_proto",
|
|
|
|
"@com_google_protobuf//:descriptor_proto",
|
|
|
|
"@com_google_protobuf//:duration_proto",
|
|
|
|
"@com_google_protobuf//:empty_proto",
|
|
|
|
"@com_google_protobuf//:field_mask_proto",
|
|
|
|
"@com_google_protobuf//:source_context_proto",
|
|
|
|
"@com_google_protobuf//:struct_proto",
|
|
|
|
"@com_google_protobuf//:timestamp_proto",
|
|
|
|
"@com_google_protobuf//:type_proto",
|
|
|
|
"@com_google_protobuf//:wrappers_proto",
|
2022-05-05 20:29:47 +00:00
|
|
|
],
|
2017-02-23 16:17:24 +00:00
|
|
|
command_line = "--cpp_out=$(OUT)",
|
|
|
|
runtime = ":protobuf",
|
|
|
|
visibility = ["//visibility:public"],
|
2016-12-03 00:40:50 +00:00
|
|
|
)
|
2017-01-12 17:51:04 +00:00
|
|
|
|
2018-11-01 13:37:14 +00:00
|
|
|
alias(
|
|
|
|
name = "objectivec",
|
2020-07-08 15:21:38 +00:00
|
|
|
actual = "//objectivec",
|
2022-05-05 00:30:23 +00:00
|
|
|
tags = ["manual"],
|
2018-11-01 13:37:14 +00:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2017-05-01 16:49:26 +00:00
|
|
|
|
2020-07-08 15:21:38 +00:00
|
|
|
alias(
|
2018-11-01 13:37:14 +00:00
|
|
|
name = "protobuf_objc",
|
2020-07-08 15:21:38 +00:00
|
|
|
actual = "//objectivec",
|
2022-05-05 00:30:23 +00:00
|
|
|
tags = ["manual"],
|
2017-05-01 16:49:26 +00:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2018-03-27 02:08:26 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Test generated proto support
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = "generated_protos",
|
|
|
|
srcs = ["src/google/protobuf/unittest_import.proto"],
|
2022-05-05 00:30:23 +00:00
|
|
|
outs = ["unittest_gen_import.proto"],
|
2022-05-13 02:48:58 +00:00
|
|
|
cmd = "cat $(SRCS) > $(OUTS)",
|
2018-03-27 02:08:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "generated_protos_proto",
|
2022-05-13 02:48:58 +00:00
|
|
|
srcs = [":generated_protos"],
|
|
|
|
deps = [":generic_test_protos"],
|
2018-03-27 02:08:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
py_proto_library(
|
|
|
|
name = "generated_protos_py",
|
2022-05-13 02:48:58 +00:00
|
|
|
srcs = [":generated_protos"],
|
2018-03-27 02:08:26 +00:00
|
|
|
default_runtime = "",
|
|
|
|
protoc = ":protoc",
|
2022-05-13 02:48:58 +00:00
|
|
|
deps = ["//python:python_common_test_protos"],
|
2018-03-27 02:08:26 +00:00
|
|
|
)
|
2018-11-03 19:59:45 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Conformance tests
|
|
|
|
################################################################################
|
|
|
|
|
2022-05-06 20:30:48 +00:00
|
|
|
alias(
|
|
|
|
name = "conformance_test_runner",
|
|
|
|
actual = "//conformance:conformance_test_runner",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2018-11-03 19:59:45 +00:00
|
|
|
proto_library(
|
|
|
|
name = "test_messages_proto2_proto",
|
2019-05-13 14:45:30 +00:00
|
|
|
srcs = ["src/google/protobuf/test_messages_proto2.proto"],
|
2022-05-17 20:26:46 +00:00
|
|
|
strip_import_prefix = "src",
|
2018-11-03 21:43:20 +00:00
|
|
|
visibility = ["//visibility:public"],
|
2018-11-03 19:59:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "test_messages_proto3_proto",
|
2019-05-13 14:45:30 +00:00
|
|
|
srcs = ["src/google/protobuf/test_messages_proto3.proto"],
|
2022-05-17 20:26:46 +00:00
|
|
|
strip_import_prefix = "src",
|
2019-07-01 19:21:04 +00:00
|
|
|
visibility = ["//visibility:public"],
|
2018-11-03 19:59:45 +00:00
|
|
|
deps = [
|
|
|
|
":any_proto",
|
|
|
|
":duration_proto",
|
|
|
|
":field_mask_proto",
|
|
|
|
":struct_proto",
|
|
|
|
":timestamp_proto",
|
|
|
|
":wrappers_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-09-09 19:21:44 +00:00
|
|
|
# TODO: re-enable this test if appropriate, or replace with something that
|
|
|
|
# uses the new setup.
|
|
|
|
# sh_test(
|
|
|
|
# name = "build_files_updated_unittest",
|
|
|
|
# srcs = [
|
|
|
|
# "build_files_updated_unittest.sh",
|
|
|
|
# ],
|
|
|
|
# data = [
|
|
|
|
# "BUILD",
|
|
|
|
# "cmake/extract_includes.bat.in",
|
|
|
|
# "cmake/libprotobuf.cmake",
|
|
|
|
# "cmake/libprotobuf-lite.cmake",
|
|
|
|
# "cmake/libprotoc.cmake",
|
|
|
|
# "cmake/tests.cmake",
|
|
|
|
# "src/Makefile.am",
|
|
|
|
# "update_file_lists.sh",
|
|
|
|
# ],
|
|
|
|
# )
|
2021-04-20 18:36:32 +00:00
|
|
|
|
|
|
|
java_proto_library(
|
|
|
|
name = "test_messages_proto2_java_proto",
|
|
|
|
visibility = [
|
2022-05-06 20:30:48 +00:00
|
|
|
"//conformance:__pkg__",
|
2021-04-20 18:36:32 +00:00
|
|
|
"//java:__subpackages__",
|
|
|
|
],
|
|
|
|
deps = [":test_messages_proto2_proto"],
|
|
|
|
)
|
|
|
|
|
|
|
|
java_proto_library(
|
|
|
|
name = "test_messages_proto3_java_proto",
|
|
|
|
visibility = [
|
2022-05-06 20:30:48 +00:00
|
|
|
"//conformance:__pkg__",
|
2021-04-20 18:36:32 +00:00
|
|
|
"//java:__subpackages__",
|
2021-08-04 12:03:24 +00:00
|
|
|
],
|
2021-04-20 18:36:32 +00:00
|
|
|
deps = [":test_messages_proto3_proto"],
|
|
|
|
)
|
|
|
|
|
|
|
|
java_lite_proto_library(
|
|
|
|
name = "test_messages_proto2_java_proto_lite",
|
|
|
|
visibility = [
|
2022-05-06 20:30:48 +00:00
|
|
|
"//conformance:__pkg__",
|
2021-04-20 18:36:32 +00:00
|
|
|
"//java:__subpackages__",
|
|
|
|
],
|
|
|
|
deps = [":test_messages_proto2_proto"],
|
|
|
|
)
|
|
|
|
|
|
|
|
java_lite_proto_library(
|
|
|
|
name = "test_messages_proto3_java_proto_lite",
|
|
|
|
visibility = [
|
2022-05-06 20:30:48 +00:00
|
|
|
"//conformance:__pkg__",
|
2021-04-20 18:36:32 +00:00
|
|
|
"//java:__subpackages__",
|
|
|
|
],
|
|
|
|
deps = [":test_messages_proto3_proto"],
|
|
|
|
)
|
|
|
|
|
2021-08-06 15:08:32 +00:00
|
|
|
filegroup(
|
|
|
|
name = "bzl_srcs",
|
|
|
|
srcs = glob(["**/*.bzl"]),
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2022-02-01 18:24:53 +00:00
|
|
|
|
|
|
|
# Kotlin proto rules
|
|
|
|
|
2022-02-17 17:53:51 +00:00
|
|
|
proto_library(
|
|
|
|
name = "kt_unittest_lite",
|
2022-02-01 18:24:53 +00:00
|
|
|
srcs = [
|
2022-04-20 23:26:44 +00:00
|
|
|
"src/google/protobuf/map_lite_unittest.proto",
|
2022-02-01 18:24:53 +00:00
|
|
|
"src/google/protobuf/unittest_import_lite.proto",
|
|
|
|
"src/google/protobuf/unittest_import_public_lite.proto",
|
2022-04-20 23:26:44 +00:00
|
|
|
"src/google/protobuf/unittest_lite.proto",
|
2022-02-01 18:24:53 +00:00
|
|
|
],
|
2022-02-17 17:53:51 +00:00
|
|
|
strip_import_prefix = "src",
|
2022-05-17 20:26:46 +00:00
|
|
|
visibility = ["//java/kotlin-lite:__subpackages__"],
|
2022-02-17 17:53:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "kt_unittest",
|
2022-02-01 18:24:53 +00:00
|
|
|
srcs = [
|
2022-04-20 23:26:44 +00:00
|
|
|
"src/google/protobuf/map_proto2_unittest.proto",
|
2022-02-01 18:24:53 +00:00
|
|
|
"src/google/protobuf/unittest.proto",
|
|
|
|
"src/google/protobuf/unittest_import.proto",
|
|
|
|
"src/google/protobuf/unittest_import_public.proto",
|
|
|
|
],
|
2022-02-17 17:53:51 +00:00
|
|
|
strip_import_prefix = "src",
|
2022-05-17 20:26:46 +00:00
|
|
|
visibility = ["//java/kotlin:__subpackages__"],
|
2022-02-01 18:24:53 +00:00
|
|
|
)
|
|
|
|
|
2022-02-17 17:53:51 +00:00
|
|
|
proto_library(
|
|
|
|
name = "kt_proto3_unittest",
|
2022-02-01 18:24:53 +00:00
|
|
|
srcs = [
|
|
|
|
"src/google/protobuf/unittest_import.proto",
|
|
|
|
"src/google/protobuf/unittest_import_public.proto",
|
2022-04-20 23:26:44 +00:00
|
|
|
"src/google/protobuf/unittest_proto3.proto",
|
2022-02-01 18:24:53 +00:00
|
|
|
],
|
2022-05-17 20:26:46 +00:00
|
|
|
strip_import_prefix = "src",
|
2022-05-05 20:29:47 +00:00
|
|
|
visibility = [
|
|
|
|
"//java/kotlin:__subpackages__",
|
|
|
|
"//java/kotlin-lite:__subpackages__",
|
|
|
|
],
|
2022-02-17 17:53:51 +00:00
|
|
|
)
|
|
|
|
|
2022-04-22 23:58:16 +00:00
|
|
|
################################################################################
|
|
|
|
# Packaging rules
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# Files included in all source distributions
|
|
|
|
pkg_files(
|
|
|
|
name = "common_dist_files",
|
2022-05-05 00:30:23 +00:00
|
|
|
srcs = glob(
|
|
|
|
[
|
|
|
|
"*.bzl",
|
|
|
|
"cmake/*.cmake",
|
|
|
|
"cmake/*.in",
|
|
|
|
"editors/*",
|
|
|
|
|
|
|
|
# Several of these files are generated by autogen.sh, so using
|
|
|
|
# glob() lets us ignore them if they are missing. (This is not good
|
|
|
|
# practice, though.)
|
|
|
|
"Makefile.in",
|
|
|
|
"aclocal.m4",
|
|
|
|
"ar-lib",
|
|
|
|
"compile",
|
|
|
|
"config*",
|
|
|
|
"depcomp",
|
|
|
|
"install-sh",
|
|
|
|
"ltmain.sh",
|
|
|
|
"m4/*.m4",
|
|
|
|
"missing",
|
|
|
|
"protobuf*.pc.in",
|
|
|
|
"test-driver",
|
|
|
|
],
|
|
|
|
allow_empty = True,
|
|
|
|
) + [
|
2022-04-30 00:57:55 +00:00
|
|
|
"BUILD.bazel",
|
2022-04-22 23:58:16 +00:00
|
|
|
"CHANGES.txt",
|
|
|
|
"CMakeLists.txt",
|
|
|
|
"CONTRIBUTORS.txt",
|
|
|
|
"LICENSE",
|
|
|
|
"Makefile.am",
|
|
|
|
"README.md",
|
|
|
|
"WORKSPACE",
|
|
|
|
"autogen.sh",
|
|
|
|
"build_files_updated_unittest.sh",
|
|
|
|
"cmake/CMakeLists.txt",
|
|
|
|
"cmake/README.md",
|
|
|
|
"generate_descriptor_proto.sh",
|
|
|
|
"maven_install.json",
|
|
|
|
"update_file_lists.sh",
|
2022-05-09 23:32:59 +00:00
|
|
|
"//third_party:BUILD.bazel",
|
2022-04-22 23:58:16 +00:00
|
|
|
"//third_party:zlib.BUILD",
|
2022-04-30 00:57:55 +00:00
|
|
|
"//util/python:BUILD.bazel",
|
2022-04-22 23:58:16 +00:00
|
|
|
],
|
|
|
|
strip_prefix = strip_prefix.from_root(""),
|
|
|
|
visibility = ["//pkg:__pkg__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
# C++ runtime
|
|
|
|
pkg_files(
|
|
|
|
name = "cpp_dist_files",
|
|
|
|
srcs = glob(
|
|
|
|
["src/**/*"],
|
|
|
|
exclude = [
|
|
|
|
"src/google/protobuf/compiler/objectivec/method_dump.sh", # not in autotools dist
|
|
|
|
],
|
|
|
|
),
|
|
|
|
strip_prefix = strip_prefix.from_root(""),
|
|
|
|
visibility = ["//pkg:__pkg__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Additional files for C#
|
|
|
|
pkg_files(
|
|
|
|
name = "csharp_dist_files",
|
|
|
|
srcs = [
|
|
|
|
"global.json",
|
|
|
|
],
|
|
|
|
visibility = ["//pkg:__pkg__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Additional files for ObjC
|
|
|
|
pkg_files(
|
|
|
|
name = "objectivec_dist_files",
|
|
|
|
srcs = [
|
|
|
|
"Protobuf.podspec",
|
|
|
|
],
|
|
|
|
visibility = ["//pkg:__pkg__"],
|
|
|
|
)
|