Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ios/RNMParticle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
B39BCD932E30562400FC90B8 /* RoktLayoutManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoktLayoutManager.m; sourceTree = "<group>"; };
C4A1D2E32F6A000100ABCDEF /* RoktPlaceholderRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoktPlaceholderRegistry.h; sourceTree = "<group>"; };
C4A1D2E42F6A000100ABCDEF /* RoktPlaceholderRegistry.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoktPlaceholderRegistry.m; sourceTree = "<group>"; };
C4A1D2E62F6A000100ABCDEF /* RNMPSDKImports.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNMPSDKImports.h; sourceTree = "<group>"; };
B39BCD942E30562400FC90B8 /* RoktNativeLayoutComponentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoktNativeLayoutComponentView.h; sourceTree = "<group>"; };
B39BCD952E30562400FC90B8 /* RoktNativeLayoutComponentView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RoktNativeLayoutComponentView.mm; sourceTree = "<group>"; };
DBDF24D71E007EB1000F3D73 /* libRNMParticle.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNMParticle.a; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -79,6 +80,7 @@
B39BCD932E30562400FC90B8 /* RoktLayoutManager.m */,
C4A1D2E32F6A000100ABCDEF /* RoktPlaceholderRegistry.h */,
C4A1D2E42F6A000100ABCDEF /* RoktPlaceholderRegistry.m */,
C4A1D2E62F6A000100ABCDEF /* RNMPSDKImports.h */,
B39BCD942E30562400FC90B8 /* RoktNativeLayoutComponentView.h */,
B39BCD952E30562400FC90B8 /* RoktNativeLayoutComponentView.mm */,
B39BCD892E2A06D700FC90B8 /* RNMPRokt.h */,
Expand Down
17 changes: 1 addition & 16 deletions ios/RNMParticle/RNMPRokt.mm
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
#import "RNMPRokt.h"
// SDK 9.0: ObjC headers moved to mParticle_Apple_SDK_ObjC module
#if defined(__has_include) && __has_include(<mParticle_Apple_SDK_ObjC/mParticle.h>)
#import <mParticle_Apple_SDK_ObjC/mParticle.h>
#import <mParticle_Apple_SDK_ObjC/MPRokt.h>
#elif defined(__has_include) && __has_include(<mParticle_Apple_SDK/mParticle.h>)
#import <mParticle_Apple_SDK/mParticle.h>
#import <mParticle_Apple_SDK/MPRokt.h>
#else
#import <mParticle_Apple_SDK_ObjC/mParticle.h>
#import <mParticle_Apple_SDK_ObjC/MPRokt.h>
#endif
#if __has_include(<RoktContracts/RoktContracts-Swift.h>)
#import <RoktContracts/RoktContracts-Swift.h>
#elif __has_include(<RoktContracts/RoktContracts.h>)
#import <RoktContracts/RoktContracts.h>
#endif
#import "RNMPSDKImports.h"
#import <React/RCTConvert.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
Expand Down
28 changes: 28 additions & 0 deletions ios/RNMParticle/RNMPSDKImports.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Private: the mParticle and RoktContracts headers, for every way an app can supply the SDKs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is right for this PR on its own. #425, later in this stack, adds s.private_header_files = 'ios/**/*.h' to the podspec, which makes every implementation header private, this one included. The stack merges into workstation/spm-migration as a whole before anything reaches main, so the in-between state is never released.

// - CocoaPods (static library or framework): <mParticle_Apple_SDK_ObjC/...>, <RoktContracts/RoktContracts-Swift.h>
// - a manually embedded xcframework: <mParticle_Apple_SDK/...>, <RoktContracts/RoktContracts.h>
// - flat public headers on the search path, as in a Swift Package Manager build: "mParticle.h"
// - last resort, module import: works in .m files only, because this pod builds .mm files
// without -fcxx-modules.
#if __has_include(<mParticle_Apple_SDK_ObjC/mParticle.h>)
#import <mParticle_Apple_SDK_ObjC/mParticle.h>
#import <mParticle_Apple_SDK_ObjC/MPRokt.h>
#elif __has_include(<mParticle_Apple_SDK/mParticle.h>)
#import <mParticle_Apple_SDK/mParticle.h>
#import <mParticle_Apple_SDK/MPRokt.h>
#elif __has_include("mParticle.h")
#import "mParticle.h"
#import "MPRokt.h"
#else
@import mParticle_Apple_SDK_ObjC;
#endif

#if __has_include(<RoktContracts/RoktContracts-Swift.h>)
#import <RoktContracts/RoktContracts-Swift.h>
#elif __has_include(<RoktContracts/RoktContracts.h>)
#import <RoktContracts/RoktContracts.h>
#elif __has_include("RoktContracts-Swift.h")
#import "RoktContracts-Swift.h"
#else
@import RoktContracts;
#endif
10 changes: 1 addition & 9 deletions ios/RNMParticle/RNMParticle.mm
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
#import "RNMParticle.h"
#import <React/RCTConvert.h>
// SDK 9.0: ObjC headers moved to mParticle_Apple_SDK_ObjC module
#if defined(__has_include) && __has_include(<mParticle_Apple_SDK_ObjC/mParticle.h>)
#import <mParticle_Apple_SDK_ObjC/mParticle.h>
#elif defined(__has_include) && __has_include(<mParticle_Apple_SDK/mParticle.h>)
#import <mParticle_Apple_SDK/mParticle.h>
#else
#import <mParticle_Apple_SDK_ObjC/mParticle.h>
#endif
#import <React/RCTConvert.h>
#import "RNMPSDKImports.h"
#import <React/RCTLog.h>
#if DEBUG
#import <objc/runtime.h>
Expand Down
8 changes: 1 addition & 7 deletions ios/RNMParticle/RoktEventManager.mm
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#import "RoktEventManager.h"
// Not `@import RoktContracts` -- this file is Objective-C++ and the pod builds without
// -fcxx-modules, so the module import fails. Matches how RNMPRokt.mm imports the same types.
#if __has_include(<RoktContracts/RoktContracts-Swift.h>)
#import <RoktContracts/RoktContracts-Swift.h>
#elif __has_include(<RoktContracts/RoktContracts.h>)
#import <RoktContracts/RoktContracts.h>
#endif
#import "RNMPSDKImports.h"
#import <os/log.h>

static os_log_t _rokt_events_os_log(void) {
Expand Down
7 changes: 1 addition & 6 deletions ios/RNMParticle/RoktLayoutManager.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#import <Foundation/Foundation.h>
#import <React/RCTViewManager.h>
#if defined(__has_include) && __has_include(<mParticle_Apple_SDK_ObjC/MPRokt.h>)
#import <mParticle_Apple_SDK_ObjC/MPRokt.h>
#else
#import <mParticle_Apple_SDK/MPRokt.h>
#endif
@import RoktContracts;
#import "RNMPSDKImports.h"
#import <React/RCTInvalidating.h>
#import "RoktPlaceholderRegistry.h"

Expand Down
11 changes: 1 addition & 10 deletions ios/RNMParticle/RoktNativeLayoutComponentView.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
#import <SafariServices/SafariServices.h>
#import <React/RCTViewComponentView.h>
#import <UIKit/UIKit.h>
#if defined(__has_include) && __has_include(<mParticle_Apple_SDK_ObjC/MPRokt.h>)
#import <mParticle_Apple_SDK_ObjC/MPRokt.h>
#else
#import <mParticle_Apple_SDK/MPRokt.h>
#endif
#if __has_include(<RoktContracts/RoktContracts-Swift.h>)
#import <RoktContracts/RoktContracts-Swift.h>
#elif __has_include(<RoktContracts/RoktContracts.h>)
#import <RoktContracts/RoktContracts.h>
#endif
#import "RNMPSDKImports.h"

#ifndef RoktNativeLayoutComponentView_h
#define RoktNativeLayoutComponentView_h
Expand Down
Loading