|
|
|
@ -45,6 +45,7 @@ |
|
|
|
|
#include "absl/strings/str_replace.h" |
|
|
|
|
#include "absl/strings/str_split.h" |
|
|
|
|
#include "absl/strings/string_view.h" |
|
|
|
|
#include "google/protobuf/compiler/retention.h" |
|
|
|
|
#include "google/protobuf/descriptor.h" |
|
|
|
|
#include "google/protobuf/descriptor.pb.h" |
|
|
|
|
#include "google/protobuf/descriptor_legacy.h" |
|
|
|
@ -943,7 +944,7 @@ void GenerateAddFileToPool(const FileDescriptor* file, const Options& options, |
|
|
|
|
// Add messages and enums to descriptor pool.
|
|
|
|
|
FileDescriptorSet files; |
|
|
|
|
FileDescriptorProto* file_proto = files.add_file(); |
|
|
|
|
file->CopyTo(file_proto); |
|
|
|
|
*file_proto = StripSourceRetentionOptions(*file); |
|
|
|
|
|
|
|
|
|
// Filter out descriptor.proto as it cannot be depended on for now.
|
|
|
|
|
RepeatedPtrField<std::string>* dependency = |
|
|
|
@ -1086,7 +1087,7 @@ void GenerateAddFilesToPool(const FileDescriptor* file, const Options& options, |
|
|
|
|
|
|
|
|
|
if (needs_aggregate) { |
|
|
|
|
auto file_proto = sorted_file_set.add_file(); |
|
|
|
|
file_node->CopyTo(file_proto); |
|
|
|
|
*file_proto = StripSourceRetentionOptions(*file_node); |
|
|
|
|
|
|
|
|
|
// Filter out descriptor.proto as it cannot be depended on for now.
|
|
|
|
|
RepeatedPtrField<std::string>* dependency = |
|
|
|
@ -2192,8 +2193,7 @@ void GenerateCWellKnownTypes(const std::vector<const FileDescriptor*>& files, |
|
|
|
|
absl::StrReplaceAll(metadata_classname, {{"\\", "_"}}); |
|
|
|
|
metadata_classname = |
|
|
|
|
absl::StrReplaceAll(metadata_classname, {{"\\", "\\\\"}}); |
|
|
|
|
FileDescriptorProto file_proto; |
|
|
|
|
file->CopyTo(&file_proto); |
|
|
|
|
FileDescriptorProto file_proto = StripSourceRetentionOptions(*file); |
|
|
|
|
std::string serialized; |
|
|
|
|
file_proto.SerializeToString(&serialized); |
|
|
|
|
printer.Print( |
|
|
|
|