Skip to content

Commit 0b977bd

Browse files
authored
Revert "Remove #if SWIFT_PACKAGE checks for nanopb (#6163)" (#6164)
This reverts commit 303f8ca.
1 parent 1b36052 commit 0b977bd

File tree

12 files changed

+40
-23
lines changed

12 files changed

+40
-23
lines changed

Crashlytics/Crashlytics/Models/Record/FIRCLSReportAdapter.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@
2222

2323
#import "Crashlytics/Crashlytics/Components/FIRCLSUserLogging.h"
2424

25-
#import "pb.h"
26-
#import "pb_decode.h"
27-
#import "pb_encode.h"
25+
#if SWIFT_PACKAGE
26+
@import nanopb;
27+
#else
28+
#import <nanopb/pb.h>
29+
#import <nanopb/pb_decode.h>
30+
#import <nanopb/pb_encode.h>
31+
#endif
2832

2933
@implementation FIRCLSReportAdapter
3034

Crashlytics/ProtoSupport/proto_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def nanopb_rename_delete(lines):
262262

263263

264264
def nanopb_use_module_import(lines):
265-
"""Changes #include <pb.h> to include "pb.h" """ # Don't let Copybara alter these lines.
266-
return [line.replace('#include <pb.h>', '{}include "pb.h"'.format("#")) for line in lines]
265+
"""Changes #include <pb.h> to include <nanopb/pb.h>""" # Don't let Copybara alter these lines.
266+
return [line.replace('#include <pb.h>', '{}include <nanopb/pb.h>'.format("#")) for line in lines]
267267

268268

269269
def strip_trailing_whitespace(lines):

Crashlytics/Protogen/nanopb/crashlytics.nanopb.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919

2020
#ifndef PB_GOOGLE_CRASHLYTICS_CRASHLYTICS_NANOPB_H_INCLUDED
2121
#define PB_GOOGLE_CRASHLYTICS_CRASHLYTICS_NANOPB_H_INCLUDED
22-
23-
#include "pb.h"
22+
#if SWIFT_PACKAGE
23+
#include "nanopb.h"
24+
#else
25+
#include <nanopb/pb.h>
26+
#endif
2427

2528
/* @@protoc_insertion_point(includes) */
2629
#if PB_PROTO_HEADER_VERSION != 30

FirebaseInAppMessaging/Analytics/Protogen/nanopb/fiam.nanopb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#ifndef PB_LOGS_PROTO_FIREBASE_INAPPMESSAGING_FIAM_NANOPB_H_INCLUDED
2121
#define PB_LOGS_PROTO_FIREBASE_INAPPMESSAGING_FIAM_NANOPB_H_INCLUDED
22-
#include "pb.h"
22+
#include <nanopb/pb.h>
2323

2424
/* @@protoc_insertion_point(includes) */
2525
#if PB_PROTO_HEADER_VERSION != 30

FirebaseInAppMessaging/ProtoSupport/nanopb_build_protos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def nanopb_rename_delete(lines):
262262

263263

264264
def nanopb_use_module_import(lines):
265-
"""Changes #include <pb.h> to include "pb.h" """ # Don't let Copybara alter these lines.
266-
return [line.replace('#include <pb.h>', '{}include "pb.h"'.format("#")) for line in lines]
265+
"""Changes #include <pb.h> to include <nanopb/pb.h>""" # Don't let Copybara alter these lines.
266+
return [line.replace('#include <pb.h>', '{}include <nanopb/pb.h>'.format("#")) for line in lines]
267267

268268

269269
def strip_trailing_whitespace(lines):

FirebaseInAppMessaging/Sources/Analytics/Protogen/nanopb/fiam.nanopb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#ifndef PB_LOGS_PROTO_FIREBASE_INAPPMESSAGING_FIAM_NANOPB_H_INCLUDED
2121
#define PB_LOGS_PROTO_FIREBASE_INAPPMESSAGING_FIAM_NANOPB_H_INCLUDED
22-
#include "pb.h"
22+
#include <nanopb/pb.h>
2323

2424
/* @@protoc_insertion_point(includes) */
2525
#if PB_PROTO_HEADER_VERSION != 30

GoogleDataTransport/GDTCCTLibrary/GDTCCTNanopbHelpers.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@
2727
#import "GoogleDataTransport/GDTCORLibrary/Public/GDTCOREvent.h"
2828
#import "GoogleDataTransport/GDTCORLibrary/Public/GDTCORPlatform.h"
2929

30-
#import "pb.h"
31-
#import "pb_decode.h"
32-
#import "pb_encode.h"
30+
#if SWIFT_PACKAGE
31+
#import "nanopb.h"
32+
#else
33+
#import <nanopb/pb.h>
34+
#import <nanopb/pb_decode.h>
35+
#import <nanopb/pb_encode.h>
36+
#endif
3337

3438
#import "GoogleDataTransport/GDTCCTLibrary/Public/GDTCOREvent+GDTCCTSupport.h"
3539

GoogleDataTransport/GDTCCTLibrary/GDTCCTUploader.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@
2222
#import "GoogleDataTransport/GDTCORLibrary/Public/GDTCORRegistrar.h"
2323
#import "GoogleDataTransport/GDTCORLibrary/Public/GDTCORStorageProtocol.h"
2424

25-
#import "pb.h"
26-
#import "pb_decode.h"
27-
#import "pb_encode.h"
25+
#if SWIFT_PACKAGE
26+
#import "nanopb.h"
27+
#else
28+
#import <nanopb/pb.h>
29+
#import <nanopb/pb_decode.h>
30+
#import <nanopb/pb_encode.h>
31+
#endif
2832

2933
#import "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTCompressionHelper.h"
3034
#import "GoogleDataTransport/GDTCCTLibrary/Private/GDTCCTNanopbHelpers.h"

GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919

2020
#ifndef PB_GDT_CCT_CCT_NANOPB_H_INCLUDED
2121
#define PB_GDT_CCT_CCT_NANOPB_H_INCLUDED
22-
23-
#include "pb.h"
22+
#if SWIFT_PACKAGE
23+
#include "nanopb.h"
24+
#else
25+
#include <nanopb/pb.h>
26+
#endif
2427

2528
/* @@protoc_insertion_point(includes) */
2629
#if PB_PROTO_HEADER_VERSION != 30

GoogleDataTransport/ProtoSupport/proto_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def nanopb_rename_delete(lines):
262262

263263

264264
def nanopb_use_module_import(lines):
265-
"""Changes #include <pb.h> to include "pb.h" """ # Don't let Copybara alter these lines.
266-
return [line.replace('#include <pb.h>', '{}include "pb.h"'.format("#")) for line in lines]
265+
"""Changes #include <pb.h> to include <nanopb/pb.h>""" # Don't let Copybara alter these lines.
266+
return [line.replace('#include <pb.h>', '{}include <nanopb/pb.h>'.format("#")) for line in lines]
267267

268268

269269
def strip_trailing_whitespace(lines):

0 commit comments

Comments
 (0)