Skip to content

Commit 8745cc0

Browse files
authored
ref: Convert SentryCrashWrapper to Swift (#6047)
* ref: Convert `SentryCrashWrapper` to Swift * Fix build * fix imports within extern "C" * Fix imports * Update references * Fix build issues on SPM * Add Swift precompiler directives for uidevice wrapper * Use SentryDependencies.uiDeviceWrapper in SentryDependencyContainer * Add unit tests for SentryCrashWrapper * Inject ProcessInfo into SentryCrashWrapper * Inject `MockSentryProcessInfo` into Hub's SentryCrashWrapper * Fix comment placement * PR review fixes * Fix build * Fix tests on macOS catalyst * Lazy init systemInfo
1 parent c1f202e commit 8745cc0

File tree

60 files changed

+582
-535
lines changed

Some content is hidden

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

60 files changed

+582
-535
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 28 additions & 22 deletions
Large diffs are not rendered by default.

SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#import "SentryCrashCachedData.h"
3232
#import "SentryCrashInstallation+Private.h"
3333
#import "SentryCrashMonitor_MachException.h"
34-
#import "SentryCrashWrapper.h"
3534
#import "SentryDebugImageProvider+HybridSDKs.h"
3635
#import "SentryDependencyContainer.h"
3736
#import "SentryDispatchFactory.h"

Sources/Sentry/SentryANRTrackerV1.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#import "SentryANRTrackerV1.h"
2-
#import "SentryCrashWrapper.h"
32
#import "SentryDependencyContainer.h"
43
#import "SentryLogC.h"
54
#import "SentrySwift.h"

Sources/Sentry/SentryANRTrackerV2.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#if SENTRY_HAS_UIKIT
44

5-
# import "SentryCrashWrapper.h"
65
# import "SentryDependencyContainer.h"
76
# import "SentryFramesTracker.h"
87
# import "SentryLogC.h"

Sources/Sentry/SentryANRTrackingIntegration.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#import "SentryANRTrackingIntegration.h"
22
#import "SentryClient+Private.h"
33
#import "SentryCrashMachineContext.h"
4-
#import "SentryCrashWrapper.h"
54
#import "SentryDebugImageProvider+HybridSDKs.h"
65
#import "SentryDependencyContainer.h"
76
#import "SentryEvent.h"
@@ -17,7 +16,6 @@
1716
#import "SentryThread.h"
1817
#import "SentryThreadInspector.h"
1918
#import "SentryThreadWrapper.h"
20-
#import <SentryCrashWrapper.h>
2119
#import <SentryOptions+Private.h>
2220

2321
#if SENTRY_HAS_UIKIT

Sources/Sentry/SentryAppStartTrackingIntegration.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# import "SentrySwift.h"
99
# import <PrivateSentrySDKOnly.h>
1010
# import <SentryAppStateManager.h>
11-
# import <SentryCrashWrapper.h>
1211
# import <SentryDependencyContainer.h>
1312

1413
@interface SentryAppStartTrackingIntegration ()

Sources/Sentry/SentryAppStateManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#import "SentryNotificationNames.h"
44
#import "SentrySysctl.h"
55
#import <SentryAppStateManager.h>
6-
#import <SentryCrashWrapper.h>
76
#import <SentryFileManager.h>
87
#import <SentryOptions.h>
98
#import <SentrySwift.h>

Sources/Sentry/SentryBaseIntegration.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#import "SentryBaseIntegration.h"
2-
#import "SentryCrashWrapper.h"
32
#import "SentryLogC.h"
43
#import "SentrySwift.h"
54
#import <SentryDependencyContainer.h>

Sources/Sentry/SentryCrashIntegration.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#import "SentryCrashIntegrationSessionHandler.h"
66
#import "SentryCrashMonitor_CPPException.h"
77
#include "SentryCrashMonitor_Signal.h"
8-
#import "SentryCrashWrapper.h"
98
#import "SentryEvent.h"
109
#import "SentryHub.h"
1110
#import "SentryModels+Serializable.h"
@@ -62,7 +61,7 @@ @implementation SentryCrashIntegration
6261

6362
- (instancetype)init
6463
{
65-
self = [self initWithCrashAdapter:[SentryCrashWrapper sharedInstance]
64+
self = [self initWithCrashAdapter:SentryDependencyContainer.sharedInstance.crashWrapper
6665
andDispatchQueueWrapper:[[SentryDispatchQueueWrapper alloc] init]];
6766

6867
return self;

Sources/Sentry/SentryCrashIntegrationSessionHandler.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#import "SentryCrashIntegrationSessionHandler.h"
22
#import "SentryClient+Private.h"
3-
#import "SentryCrashWrapper.h"
43
#import "SentryDependencyContainer.h"
54
#import "SentryFileManager.h"
65
#import "SentryHub.h"

0 commit comments

Comments
 (0)