Skip to content

Commit f7afb06

Browse files
authored
[E2-2118] Adding support for SPM 5.3 (#389)
* Adding support for SPM 5.3 * Fixing wrong directory path * Using in-memory database
1 parent 03a8619 commit f7afb06

File tree

91 files changed

+149
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+149
-5
lines changed

Example/Tests/Classes/LPEventDataManagerTest.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525

2626
#import <XCTest/XCTest.h>
27+
#import <OCMock/OCMock.h>
2728
#import <OHHTTPStubs/HTTPStubs.h>
2829
#import <OHHTTPStubs/HTTPStubsPathHelpers.h>
2930
#import "LeanplumHelper.h"
@@ -51,6 +52,8 @@ @interface LPEventDataManagerTest : XCTestCase
5152
@implementation LPEventDataManagerTest
5253

5354
- (void)setUp {
55+
id mockedDB = OCMClassMock([LPDatabase class]);
56+
OCMStub([mockedDB sqliteFilePath]).andReturn(@":memory:");
5457
[super setUp];
5558
}
5659

Example/Tests/Classes/Utilities/LeanplumHelper.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ + (dispatch_time_t)default_dispatch_time {
151151
}
152152

153153
+ (NSString *)retrieve_string_from_file:(NSString *)file ofType:(NSString *)type {
154+
#if SWIFTPM_MODULE_BUNDLE
155+
NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
156+
#else
154157
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
158+
#endif
155159
NSString *path = [bundle pathForResource:file ofType:type];
156160
NSString *content = [NSString stringWithContentsOfFile:path
157161
encoding:NSUTF8StringEncoding
@@ -161,7 +165,11 @@ + (NSString *)retrieve_string_from_file:(NSString *)file ofType:(NSString *)type
161165
}
162166

163167
+ (NSData *)retrieve_data_from_file:(NSString *)file ofType:(NSString *)type {
168+
#if SWIFTPM_MODULE_BUNDLE
169+
NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
170+
#else
164171
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
172+
#endif
165173
NSString *path = [bundle pathForResource:file ofType:type];
166174

167175
return [[NSFileManager defaultManager] contentsAtPath:path];

Leanplum-SDK/Classes/MessageTemplates/ViewControllers/LPInterstitialViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ @implementation LPInterstitialViewController
1717

1818
+(LPInterstitialViewController *)instantiateFromStoryboard
1919
{
20+
#if SWIFTPM_MODULE_BUNDLE
21+
NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
22+
#else
2023
NSBundle *bundle = [NSBundle bundleForClass:[Leanplum class]];
24+
#endif
2125
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Interstitial" bundle:bundle];
2226

2327
return [storyboard instantiateInitialViewController];

Leanplum-SDK/Classes/MessageTemplates/ViewControllers/LPPopupViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ @implementation LPPopupViewController
2020

2121
+(LPPopupViewController *)instantiateFromStoryboard
2222
{
23+
#if SWIFTPM_MODULE_BUNDLE
24+
NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
25+
#else
2326
NSBundle *bundle = [NSBundle bundleForClass:[Leanplum class]];
27+
#endif
2428
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Popup" bundle:bundle];
2529

2630
return [storyboard instantiateInitialViewController];

Leanplum-SDK/Classes/MessageTemplates/ViewControllers/LPWebInterstitialViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ @implementation LPWebInterstitialViewController
2222

2323
+(LPWebInterstitialViewController *)instantiateFromStoryboard
2424
{
25+
#if SWIFTPM_MODULE_BUNDLE
26+
NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
27+
#else
2528
NSBundle *bundle = [NSBundle bundleForClass:[Leanplum class]];
29+
#endif
2630
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"WebInterstitial" bundle:bundle];
2731

2832
return [storyboard instantiateInitialViewController];

Leanplum-SDK/include/FileMD5Hash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Classes/Utilities/FileMD5Hash.h

Leanplum-SDK/include/LPAES.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Classes/Utilities/Encryption/LPAES.h

Leanplum-SDK/include/LPAPIConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Classes/Managers/Networking/LPAPIConfig.h

Leanplum-SDK/include/LPActionArg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Classes/LPActionArg.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Classes/Features/Actions/LPActionContext-Internal.h

0 commit comments

Comments
 (0)