Skip to content

Commit

Permalink
Add descriptor.proto to the list of bundled proto files.
Browse files Browse the repository at this point in the history
To support building after apple/swift-protobuf#727.

RELNOTES: None
PiperOrigin-RevId: 263117318
  • Loading branch information
thomasvl authored and swiple-rules-gardener committed Aug 13, 2019
1 parent 99d9d1a commit 8d61a41
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions swift/internal/swift_protoc_gen_aspect.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ load(
load(":providers.bzl", "SwiftInfo", "SwiftProtoInfo", "SwiftToolchainInfo")
load(":utils.bzl", "compact", "create_cc_info", "get_providers", "workspace_relative_path")

# The paths of well known type protos that should not be generated by the aspect
# because they are already included in the SwiftProtobuf runtime. The plugin
# provides the mapping from these protos to the SwiftProtobuf module for us.
# The paths of proto files bundled with the runtime. This is mainly the well
# known type protos, but also includes descriptor.proto to make generation of
# files that include options easier. These files should not be generated by
# the aspect because they are already included in the SwiftProtobuf runtime.
# The plugin provides the mapping from these protos to the SwiftProtobuf
# module for us.
# TODO(b/63389580): Once we migrate to proto_lang_toolchain, this information
# can go in the blacklisted_protos list instead.
_WELL_KNOWN_TYPE_PATHS = [
_RUNTIME_BUNDLED_PROTO_FILES = [
"google/protobuf/any.proto",
"google/protobuf/api.proto",
"google/protobuf/descriptor.proto",
"google/protobuf/duration.proto",
"google/protobuf/empty.proto",
"google/protobuf/field_mask.proto",
Expand Down Expand Up @@ -76,7 +80,7 @@ def _filter_out_well_known_types(srcs):
return [
f
for f in srcs
if workspace_relative_path(f) not in _WELL_KNOWN_TYPE_PATHS
if workspace_relative_path(f) not in _RUNTIME_BUNDLED_PROTO_FILES
]

def _register_pbswift_generate_action(
Expand Down

0 comments on commit 8d61a41

Please sign in to comment.