Commit 5e026abd authored by Laszlo Csomor's avatar Laszlo Csomor

Merge branch 'master' into expand-wildcards

parents a700fc7a a03d332a
...@@ -242,38 +242,36 @@ cc_library( ...@@ -242,38 +242,36 @@ cc_library(
# Map of all well known protos. # Map of all well known protos.
# name => (include path, imports) # name => (include path, imports)
WELL_KNOWN_PROTO_MAP = { WELL_KNOWN_PROTO_MAP = {
"any": ("google/protobuf/any.proto", []), "any": ("src/google/protobuf/any.proto", []),
"api": ( "api": (
"google/protobuf/api.proto", "src/google/protobuf/api.proto",
[ [
"source_context", "source_context",
"type", "type",
], ],
), ),
"compiler_plugin": ( "compiler_plugin": (
"google/protobuf/compiler/plugin.proto", "src/google/protobuf/compiler/plugin.proto",
["descriptor"], ["descriptor"],
), ),
"descriptor": ("google/protobuf/descriptor.proto", []), "descriptor": ("src/google/protobuf/descriptor.proto", []),
"duration": ("google/protobuf/duration.proto", []), "duration": ("src/google/protobuf/duration.proto", []),
"empty": ("google/protobuf/empty.proto", []), "empty": ("src/google/protobuf/empty.proto", []),
"field_mask": ("google/protobuf/field_mask.proto", []), "field_mask": ("src/google/protobuf/field_mask.proto", []),
"source_context": ("google/protobuf/source_context.proto", []), "source_context": ("src/google/protobuf/source_context.proto", []),
"struct": ("google/protobuf/struct.proto", []), "struct": ("src/google/protobuf/struct.proto", []),
"timestamp": ("google/protobuf/timestamp.proto", []), "timestamp": ("src/google/protobuf/timestamp.proto", []),
"type": ( "type": (
"google/protobuf/type.proto", "src/google/protobuf/type.proto",
[ [
"any", "any",
"source_context", "source_context",
], ],
), ),
"wrappers": ("google/protobuf/wrappers.proto", []), "wrappers": ("src/google/protobuf/wrappers.proto", []),
} }
RELATIVE_WELL_KNOWN_PROTOS = [proto[1][0] for proto in WELL_KNOWN_PROTO_MAP.items()] WELL_KNOWN_PROTOS = [value[0] for value in WELL_KNOWN_PROTO_MAP.values()]
WELL_KNOWN_PROTOS = ["src/" + s for s in RELATIVE_WELL_KNOWN_PROTOS]
filegroup( filegroup(
name = "well_known_protos", name = "well_known_protos",
...@@ -303,17 +301,10 @@ cc_proto_library( ...@@ -303,17 +301,10 @@ cc_proto_library(
# ) # )
################################################################################ ################################################################################
internal_copied_filegroup(
name = "_internal_wkt_protos",
srcs = WELL_KNOWN_PROTOS,
dest = "",
strip_prefix = "src",
visibility = ["//visibility:private"],
)
[proto_library( [proto_library(
name = proto[0] + "_proto", name = proto[0] + "_proto",
srcs = [proto[1][0]], srcs = [proto[1][0]],
strip_import_prefix = "src",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [dep + "_proto" for dep in proto[1][1]], deps = [dep + "_proto" for dep in proto[1][1]],
) for proto in WELL_KNOWN_PROTO_MAP.items()] ) for proto in WELL_KNOWN_PROTO_MAP.items()]
...@@ -875,7 +866,7 @@ internal_copied_filegroup( ...@@ -875,7 +866,7 @@ internal_copied_filegroup(
# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in # TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
# which case we can simply add :protos_python in srcs. # which case we can simply add :protos_python in srcs.
COPIED_WELL_KNOWN_PROTOS = ["python/" + s for s in RELATIVE_WELL_KNOWN_PROTOS] COPIED_WELL_KNOWN_PROTOS = ["python/" + s[4:] for s in WELL_KNOWN_PROTOS]
py_proto_library( py_proto_library(
name = "protobuf_python", name = "protobuf_python",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment