Skip to content

Commit

Permalink
Simplify imports of the WKTs within the library itself.
Browse files Browse the repository at this point in the history
Overdue followup to protocolbuffers#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.
  • Loading branch information
thomasvl committed Mar 1, 2022
1 parent 4b0871e commit 9e58bb3
Show file tree
Hide file tree
Showing 23 changed files with 106 additions and 375 deletions.
18 changes: 3 additions & 15 deletions objectivec/GPBAny.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 3 additions & 17 deletions objectivec/GPBAny.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 3 additions & 15 deletions objectivec/GPBApi.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 5 additions & 21 deletions objectivec/GPBApi.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 3 additions & 15 deletions objectivec/GPBDuration.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 3 additions & 17 deletions objectivec/GPBDuration.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 3 additions & 15 deletions objectivec/GPBEmpty.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 3 additions & 17 deletions objectivec/GPBEmpty.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 3 additions & 15 deletions objectivec/GPBFieldMask.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 3 additions & 17 deletions objectivec/GPBFieldMask.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 10 additions & 29 deletions objectivec/GPBProtocolBuffers.h
Expand Up @@ -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"
18 changes: 3 additions & 15 deletions objectivec/GPBSourceContext.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 3 additions & 17 deletions objectivec/GPBSourceContext.pbobjc.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 3 additions & 15 deletions objectivec/GPBStruct.pbobjc.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9e58bb3

Please sign in to comment.