Skip to content

Commit f9e69b3

Browse files
authored
Merge 2e9df51 into ad964ca
2 parents ad964ca + 2e9df51 commit f9e69b3

30 files changed

+161
-58
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,22 @@ jobs:
112112
if: startsWith(github.ref, 'refs/heads/release/') == false
113113
steps:
114114
- uses: actions/checkout@v4
115-
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace && EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk watchos -destination 'generic/platform=watchOS'
115+
116+
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
117+
- run: set -o pipefail && NSUnbufferedIO=YES EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk watchos -destination 'generic/platform=watchOS' | tee raw-build-output-spm-watchos.log | xcbeautify
116118
shell: sh
117-
- run: EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk iphoneos -destination 'generic/platform=iphoneos'
119+
- run: set -o pipefail && NSUnbufferedIO=YES EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk iphoneos -destination 'generic/platform=iphoneos' | tee raw-build-output-spm-iphoneos.log | xcbeautify
118120
shell: sh
119121

122+
- name: Upload SPM Build Logs
123+
uses: actions/upload-artifact@v4
124+
if: ${{ failure() || cancelled() }}
125+
with:
126+
name: raw-build-output-spm
127+
path: |
128+
raw-build-output-spm-watchos.log
129+
raw-build-output-spm-iphoneos.log
130+
120131
build-v9:
121132
name: Build SDK v9
122133
runs-on: macos-15

Package.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,18 @@ let env = getenv("EXPERIMENTAL_SPM_BUILDS")
4747
if let env = env, String(cString: env, encoding: .utf8) == "1" {
4848
products.append(.library(name: "SentrySPM", type: .dynamic, targets: ["SentryObjc"]))
4949
targets.append(contentsOf: [
50-
// At least one source file is required
51-
.target(name: "SentryHeaders", path: "Sources/Sentry", sources: ["SentryDsn.m"], publicHeadersPath: "Public"),
50+
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
51+
.target(
52+
name: "SentryHeaders",
53+
path: "Sources/Sentry",
54+
sources: ["SentryDummyPublicEmptyClass.m"],
55+
publicHeadersPath: "Public"
56+
),
5257
.target(
5358
name: "_SentryPrivate",
5459
dependencies: ["SentryHeaders"],
5560
path: "Sources/Sentry",
56-
sources: ["NSLocale+Sentry.m"],
61+
sources: ["SentryDummyPrivateEmptyClass.m"],
5762
publicHeadersPath: "include",
5863
cSettings: [.headerSearchPath("include/HybridPublic")]),
5964
.target(
@@ -70,7 +75,7 @@ if let env = env, String(cString: env, encoding: .utf8) == "1" {
7075
name: "SentryObjc",
7176
dependencies: ["SentrySwift"],
7277
path: "Sources",
73-
exclude: ["Sentry/SentryDsn.m", "Sentry/NSLocale+Sentry.m", "Swift", "SentrySwiftUI", "Resources", "Configuration"],
78+
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration"],
7479
cSettings: [
7580
.headerSearchPath("Sentry/include/HybridPublic"),
7681
.headerSearchPath("Sentry"),

Sentry.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,8 @@
883883
D4CD2A812DE9F91900DA9F59 /* SentryRedactRegionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4CD2A7D2DE9F91900DA9F59 /* SentryRedactRegionType.swift */; };
884884
D4E3F35D2D4A864600F79E2B /* SentryNSDictionarySanitizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D42E48582D48FC8F00D251BC /* SentryNSDictionarySanitizeTests.swift */; };
885885
D4E3F35E2D4A877300F79E2B /* SentryNSDictionarySanitize+Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = D41909942D490006002B83D0 /* SentryNSDictionarySanitize+Tests.m */; };
886+
D4ECA4012E3CBEDE00C757EA /* SentryDummyPublicEmptyClass.m in Sources */ = {isa = PBXBuildFile; fileRef = D4ECA4002E3CBEDE00C757EA /* SentryDummyPublicEmptyClass.m */; };
887+
D4ECA4022E3CBEDE00C757EA /* SentryDummyPrivateEmptyClass.m in Sources */ = {isa = PBXBuildFile; fileRef = D4ECA3FF2E3CBEDE00C757EA /* SentryDummyPrivateEmptyClass.m */; };
886888
D4EDF9842D0B2A210071E7B3 /* Data+SentryTracing.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4EDF9832D0B2A1D0071E7B3 /* Data+SentryTracing.swift */; };
887889
D4EE12D22DE9AC3800385BAF /* TestNSNotificationCenterWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4EE12D12DE9AC3300385BAF /* TestNSNotificationCenterWrapperTests.swift */; };
888890
D4F2B5352D0C69D500649E42 /* SentryCrashCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4F2B5342D0C69D100649E42 /* SentryCrashCTests.swift */; };
@@ -2205,6 +2207,8 @@
22052207
D4CBA2512DE06D1600581618 /* TestConstantTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestConstantTests.swift; sourceTree = "<group>"; };
22062208
D4CD2A7C2DE9F91900DA9F59 /* SentryRedactRegion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryRedactRegion.swift; sourceTree = "<group>"; };
22072209
D4CD2A7D2DE9F91900DA9F59 /* SentryRedactRegionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryRedactRegionType.swift; sourceTree = "<group>"; };
2210+
D4ECA3FF2E3CBEDE00C757EA /* SentryDummyPrivateEmptyClass.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDummyPrivateEmptyClass.m; sourceTree = "<group>"; };
2211+
D4ECA4002E3CBEDE00C757EA /* SentryDummyPublicEmptyClass.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDummyPublicEmptyClass.m; sourceTree = "<group>"; };
22082212
D4EDF9832D0B2A1D0071E7B3 /* Data+SentryTracing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+SentryTracing.swift"; sourceTree = "<group>"; };
22092213
D4EE12D12DE9AC3300385BAF /* TestNSNotificationCenterWrapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestNSNotificationCenterWrapperTests.swift; sourceTree = "<group>"; };
22102214
D4F2B5342D0C69D100649E42 /* SentryCrashCTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashCTests.swift; sourceTree = "<group>"; };
@@ -3087,6 +3091,8 @@
30873091
7B2BB0012966F55900A1E102 /* SentryOptionsInternal.h */,
30883092
7D9B079F23D1E89800C5FC8E /* SentryMeta.h */,
30893093
7D082B8023C628780029866B /* SentryMeta.m */,
3094+
D4ECA3FF2E3CBEDE00C757EA /* SentryDummyPrivateEmptyClass.m */,
3095+
D4ECA4002E3CBEDE00C757EA /* SentryDummyPublicEmptyClass.m */,
30903096
);
30913097
path = Sentry;
30923098
sourceTree = "<group>";
@@ -5787,6 +5793,8 @@
57875793
A8F17B2E2901765900990B25 /* SentryRequest.m in Sources */,
57885794
FABE8E172E307A7F0040809A /* Dependencies.swift in Sources */,
57895795
7BE1E33424F7E3CB009D3AD0 /* SentryMigrateSessionInit.m in Sources */,
5796+
D4ECA4012E3CBEDE00C757EA /* SentryDummyPublicEmptyClass.m in Sources */,
5797+
D4ECA4022E3CBEDE00C757EA /* SentryDummyPrivateEmptyClass.m in Sources */,
57905798
D80299502BA83A88000F0081 /* SentryPixelBuffer.swift in Sources */,
57915799
15E0A8F22411A45A00F044E3 /* SentrySession.m in Sources */,
57925800
844EDCE62947DC3100C86F34 /* SentryNSTimerFactory.m in Sources */,

Sources/Sentry/Processors/SentryWatchdogTerminationBreadcrumbProcessor.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#import "SentryWatchdogTerminationBreadcrumbProcessor.h"
22
#import "SentryFileManager.h"
3+
#import "SentryInternalDefines.h"
34
#import "SentryLogC.h"
45
#import "SentrySerialization.h"
56

@@ -44,7 +45,7 @@ - (void)addSerializedBreadcrumb:(NSDictionary *)crumb
4445
SENTRY_LOG_ERROR(@"Error serializing breadcrumb to JSON");
4546
return;
4647
}
47-
[self storeBreadcrumb:jsonData];
48+
[self storeBreadcrumb:SENTRY_UNWRAP_NULLABLE(NSData, jsonData)];
4849
}
4950

5051
- (void)clear

Sources/Sentry/SentryBinaryImageCache.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#import "SentryDefaultObjCRuntimeWrapper.h"
55
#import "SentryDependencyContainer.h"
66
#import "SentryInAppLogic.h"
7+
#import "SentryInternalDefines.h"
78
#import "SentryLogC.h"
89
#import "SentrySDK+Private.h"
910
#import "SentrySwift.h"
@@ -176,7 +177,7 @@ - (NSInteger)indexOfImage:(uint64_t)address
176177
- (NSArray<SentryBinaryImageInfo *> *)getAllBinaryImages
177178
{
178179
@synchronized(self) {
179-
return _cache.copy;
180+
return SENTRY_UNWRAP_NULLABLE(NSArray<SentryBinaryImageInfo *>, _cache.copy);
180181
}
181182
}
182183

Sources/Sentry/SentryBreadcrumb.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#import "SentryBreadcrumb.h"
22
#import "SentryBreadcrumb+Private.h"
33
#import "SentryDateUtils.h"
4+
#import "SentryInternalDefines.h"
45
#import "SentryLevelMapper.h"
56
#import "SentryNSDictionarySanitize.h"
67
#import "SentrySwift.h"
@@ -75,7 +76,7 @@ - (BOOL)isEqual:(id _Nullable)other
7576
if (!other || ![[other class] isEqual:[self class]])
7677
return NO;
7778

78-
return [self isEqualToBreadcrumb:other];
79+
return [self isEqualToBreadcrumb:SENTRY_UNWRAP_NULLABLE(SentryBreadcrumb, other)];
7980
}
8081

8182
- (BOOL)isEqualToBreadcrumb:(SentryBreadcrumb *)breadcrumb

Sources/Sentry/SentryBreadcrumbTracker.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,14 @@ + (NSDictionary *)fetchInfoAboutViewController:(UIViewController *)controller
316316

317317
if (controller.presentingViewController != nil) {
318318
info[@"presentingViewController"] =
319-
[SwiftDescriptor getViewControllerClassName:controller.presentingViewController];
319+
[SwiftDescriptor getViewControllerClassName:SENTRY_UNWRAP_NULLABLE(UIViewController,
320+
controller.presentingViewController)];
320321
}
321322

322323
if (controller.parentViewController != nil) {
323324
info[@"parentViewController"] =
324-
[SwiftDescriptor getViewControllerClassName:controller.parentViewController];
325+
[SwiftDescriptor getViewControllerClassName:SENTRY_UNWRAP_NULLABLE(UIViewController,
326+
controller.parentViewController)];
325327
}
326328

327329
if (controller.view.window != nil) {

Sources/Sentry/SentryCoreDataTracker.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ - (NSString *)descriptionFromRequest:(NSFetchRequest *)request
204204

205205
if (request.predicate) {
206206
[result appendFormat:@" WHERE %@",
207-
[predicateDescriptor predicateDescription:request.predicate]];
207+
[predicateDescriptor
208+
predicateDescription:SENTRY_UNWRAP_NULLABLE(NSPredicate, request.predicate)]];
208209
}
209210

210211
if (request.sortDescriptors.count > 0) {

Sources/Sentry/SentryCrashIntegrationSessionHandler.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#import "SentryDependencyContainer.h"
55
#import "SentryFileManager.h"
66
#import "SentryHub.h"
7+
#import "SentryInternalDefines.h"
78
#import "SentryLogC.h"
89
#import "SentrySDK+Private.h"
910
#import "SentrySession.h"
@@ -81,7 +82,8 @@ - (void)endCurrentSessionIfRequired
8182
return;
8283
}
8384

84-
[session endSessionAbnormalWithTimestamp:appHangEvent.timestamp];
85+
[session
86+
endSessionAbnormalWithTimestamp:SENTRY_UNWRAP_NULLABLE(NSDate, appHangEvent).timestamp];
8587
[fileManager storeAbnormalSession:session];
8688
[fileManager deleteCurrentSession];
8789
}

Sources/Sentry/SentryDateUtil.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import "SentryDateUtil.h"
2+
#import "SentryInternalDefines.h"
23
#import "SentrySwift.h"
34

45
NS_ASSUME_NONNULL_BEGIN
@@ -24,7 +25,8 @@ - (BOOL)isInFuture:(NSDate *_Nullable)date
2425
if (date == nil)
2526
return NO;
2627

27-
NSComparisonResult result = [[self.currentDateProvider date] compare:date];
28+
NSComparisonResult result =
29+
[[self.currentDateProvider date] compare:SENTRY_UNWRAP_NULLABLE(NSDate, date)];
2830
return result == NSOrderedAscending;
2931
}
3032

@@ -37,7 +39,8 @@ + (NSDate *_Nullable)getMaximumDate:(NSDate *_Nullable)first andOther:(NSDate *_
3739
if (second == nil)
3840
return first;
3941

40-
NSComparisonResult result = [first compare:second];
42+
NSComparisonResult result =
43+
[SENTRY_UNWRAP_NULLABLE(NSDate, first) compare:SENTRY_UNWRAP_NULLABLE(NSDate, second)];
4144
if (result == NSOrderedDescending) {
4245
return first;
4346
} else {

0 commit comments

Comments
 (0)