Simplify imports of the WKTs within the library itself.

Overdue followup to https://github.com/protocolbuffers/protobuf/pull/7173

Since all the files are at the same level as the runtime headers, there is no
need for things to be framework based imports, they should all just work like
the other headers do.

- Directly generate the bundled header imports into the preamble section when
  generating for a bundled proto.
- Update the preamble generation to skip the CPP wrapper when generating for a
  bundled proto file.
- Regenerate the WKTs.
- Update GPBProtocolBuffer.h/GPBWellKnownTypes.h to also skip the CPP wrapping.

GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS in the podspec and non bundled files still
has to exist because that comes into play for those files to find the runtime
headers.
pull/9567/head
Thomas Van Lenten 3 years ago
parent 4b0871e205
commit 020e4e33d1
  1. 18
      objectivec/GPBAny.pbobjc.h
  2. 20
      objectivec/GPBAny.pbobjc.m
  3. 18
      objectivec/GPBApi.pbobjc.h
  4. 26
      objectivec/GPBApi.pbobjc.m
  5. 18
      objectivec/GPBDuration.pbobjc.h
  6. 20
      objectivec/GPBDuration.pbobjc.m
  7. 18
      objectivec/GPBEmpty.pbobjc.h
  8. 20
      objectivec/GPBEmpty.pbobjc.m
  9. 18
      objectivec/GPBFieldMask.pbobjc.h
  10. 20
      objectivec/GPBFieldMask.pbobjc.m
  11. 39
      objectivec/GPBProtocolBuffers.h
  12. 18
      objectivec/GPBSourceContext.pbobjc.h
  13. 20
      objectivec/GPBSourceContext.pbobjc.m
  14. 18
      objectivec/GPBStruct.pbobjc.h
  15. 18
      objectivec/GPBStruct.pbobjc.m
  16. 18
      objectivec/GPBTimestamp.pbobjc.h
  17. 20
      objectivec/GPBTimestamp.pbobjc.m
  18. 18
      objectivec/GPBType.pbobjc.h
  19. 24
      objectivec/GPBType.pbobjc.m
  20. 18
      objectivec/GPBWellKnownTypes.h
  21. 18
      objectivec/GPBWrappers.pbobjc.h
  22. 20
      objectivec/GPBWrappers.pbobjc.m
  23. 36
      src/google/protobuf/compiler/objectivec/objectivec_file.cc

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/any.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,23 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/any.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBAny.pbobjc.h>
#else
#import "GPBAny.pbobjc.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBAny.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/api.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,27 +1,11 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/api.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBApi.pbobjc.h>
#import <Protobuf/GPBSourceContext.pbobjc.h>
#import <Protobuf/GPBType.pbobjc.h>
#else
#import "GPBApi.pbobjc.h"
#import "GPBSourceContext.pbobjc.h"
#import "GPBType.pbobjc.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBApi.pbobjc.h"
#import "GPBSourceContext.pbobjc.h"
#import "GPBType.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/duration.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,23 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/duration.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDuration.pbobjc.h>
#else
#import "GPBDuration.pbobjc.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBDuration.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/empty.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,23 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/empty.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBEmpty.pbobjc.h>
#else
#import "GPBEmpty.pbobjc.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBEmpty.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/field_mask.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,23 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/field_mask.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBFieldMask.pbobjc.h>
#else
#import "GPBFieldMask.pbobjc.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBFieldMask.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -44,33 +44,14 @@
#import "GPBWellKnownTypes.h"
#import "GPBWireFormat.h"
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
// Well-known proto types
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBAny.pbobjc.h>
#import <Protobuf/GPBApi.pbobjc.h>
#import <Protobuf/GPBDuration.pbobjc.h>
#import <Protobuf/GPBEmpty.pbobjc.h>
#import <Protobuf/GPBFieldMask.pbobjc.h>
#import <Protobuf/GPBSourceContext.pbobjc.h>
#import <Protobuf/GPBStruct.pbobjc.h>
#import <Protobuf/GPBTimestamp.pbobjc.h>
#import <Protobuf/GPBType.pbobjc.h>
#import <Protobuf/GPBWrappers.pbobjc.h>
#else
#import "GPBAny.pbobjc.h"
#import "GPBApi.pbobjc.h"
#import "GPBDuration.pbobjc.h"
#import "GPBEmpty.pbobjc.h"
#import "GPBFieldMask.pbobjc.h"
#import "GPBSourceContext.pbobjc.h"
#import "GPBStruct.pbobjc.h"
#import "GPBTimestamp.pbobjc.h"
#import "GPBType.pbobjc.h"
#import "GPBWrappers.pbobjc.h"
#endif
#import "GPBAny.pbobjc.h"
#import "GPBApi.pbobjc.h"
#import "GPBDuration.pbobjc.h"
#import "GPBEmpty.pbobjc.h"
#import "GPBFieldMask.pbobjc.h"
#import "GPBSourceContext.pbobjc.h"
#import "GPBStruct.pbobjc.h"
#import "GPBTimestamp.pbobjc.h"
#import "GPBType.pbobjc.h"
#import "GPBWrappers.pbobjc.h"

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/source_context.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,23 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/source_context.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBSourceContext.pbobjc.h>
#else
#import "GPBSourceContext.pbobjc.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBSourceContext.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/struct.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,25 +1,11 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/struct.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBStruct.pbobjc.h"
#import <stdatomic.h>
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBStruct.pbobjc.h>
#else
#import "GPBStruct.pbobjc.h"
#endif
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/timestamp.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,23 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/timestamp.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBTimestamp.pbobjc.h>
#else
#import "GPBTimestamp.pbobjc.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBTimestamp.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/type.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,29 +1,13 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/type.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBType.pbobjc.h"
#import "GPBAny.pbobjc.h"
#import "GPBSourceContext.pbobjc.h"
#import <stdatomic.h>
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBType.pbobjc.h>
#import <Protobuf/GPBAny.pbobjc.h>
#import <Protobuf/GPBSourceContext.pbobjc.h>
#else
#import "GPBType.pbobjc.h"
#import "GPBAny.pbobjc.h"
#import "GPBSourceContext.pbobjc.h"
#endif
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -30,21 +30,9 @@
#import <Foundation/Foundation.h>
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBAny.pbobjc.h>
#import <Protobuf/GPBDuration.pbobjc.h>
#import <Protobuf/GPBTimestamp.pbobjc.h>
#else
#import "GPBAny.pbobjc.h"
#import "GPBDuration.pbobjc.h"
#import "GPBTimestamp.pbobjc.h"
#endif
#import "GPBAny.pbobjc.h"
#import "GPBDuration.pbobjc.h"
#import "GPBTimestamp.pbobjc.h"
NS_ASSUME_NONNULL_BEGIN

@ -1,21 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/wrappers.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBDescriptor.h>
#import <Protobuf/GPBMessage.h>
#import <Protobuf/GPBRootObject.h>
#else
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#endif
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRootObject.h"
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.

@ -1,23 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/wrappers.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBWrappers.pbobjc.h>
#else
#import "GPBWrappers.pbobjc.h"
#endif
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "GPBWrappers.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push

@ -245,7 +245,7 @@ void FileGenerator::GenerateHeader(io::Printer* printer) {
generation_options_.generate_for_named_framework,
generation_options_.named_framework_to_proto_path_mappings_path,
generation_options_.runtime_import_prefix,
is_bundled_proto_);
/* include_wkt_imports = */ false);
const std::string header_extension(kHeaderExtension);
for (int i = 0; i < file_->public_dependency_count(); i++) {
import_writer.AddFile(file_->public_dependency(i), header_extension);
@ -340,8 +340,17 @@ void FileGenerator::GenerateHeader(io::Printer* printer) {
void FileGenerator::GenerateSource(io::Printer* printer) {
// #import the runtime support.
const std::string header_extension(kHeaderExtension);
std::vector<std::string> headers;
headers.push_back("GPBProtocolBuffers_RuntimeSupport.h");
if (is_bundled_proto_) {
headers.push_back("GPB" + FilePathBasename(file_) + header_extension);
for (int i = 0; i < file_->dependency_count(); i++) {
const std::string header_name =
"GPB" + FilePathBasename(file_->dependency(i)) + header_extension;
headers.push_back(header_name);
}
}
PrintFileRuntimePreamble(printer, headers);
// Enums use atomic in the generated code, so add the system import as needed.
@ -359,8 +368,7 @@ void FileGenerator::GenerateSource(io::Printer* printer) {
generation_options_.generate_for_named_framework,
generation_options_.named_framework_to_proto_path_mappings_path,
generation_options_.runtime_import_prefix,
is_bundled_proto_);
const std::string header_extension(kHeaderExtension);
/* include_wkt_imports = */ false);
// #import the header for this proto file.
import_writer.AddFile(file_, header_extension);
@ -601,8 +609,26 @@ void FileGenerator::PrintFileRuntimePreamble(
"// source: $filename$\n"
"\n",
"filename", file_->name());
ImportWriter::PrintRuntimeImports(
printer, headers_to_import, generation_options_.runtime_import_prefix, true);
if (is_bundled_proto_) {
// This is basically a clone of ImportWriter::PrintRuntimeImports() but
// without the CPP symbol gate, since within the bundled files, that isn't
// needed.
std::string import_prefix = generation_options_.runtime_import_prefix;
if (!import_prefix.empty()) {
import_prefix += "/";
}
for (const auto& header : headers_to_import) {
printer->Print(
"#import \"$import_prefix$$header$\"\n",
"import_prefix", import_prefix,
"header", header);
}
} else {
ImportWriter::PrintRuntimeImports(
printer, headers_to_import, generation_options_.runtime_import_prefix, true);
}
printer->Print("\n");
}

Loading…
Cancel
Save