Skip to content

Commit 60bce58

Browse files
noahsmartinphilprime
authored andcommitted
ref: SentryFileManager to Swift (#6159)
1 parent ba4d47d commit 60bce58

35 files changed

+409
-267
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@
178178
635B3F391EBC6E2500A6176D /* SentryAsynchronousOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 635B3F371EBC6E2500A6176D /* SentryAsynchronousOperation.m */; };
179179
6360850D1ED2AFE100E8599E /* SentryBreadcrumb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6360850B1ED2AFE100E8599E /* SentryBreadcrumb.h */; settings = {ATTRIBUTES = (Public, ); }; };
180180
6360850E1ED2AFE100E8599E /* SentryBreadcrumb.m in Sources */ = {isa = PBXBuildFile; fileRef = 6360850C1ED2AFE100E8599E /* SentryBreadcrumb.m */; };
181-
636085131ED47BE600E8599E /* SentryFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 636085111ED47BE600E8599E /* SentryFileManager.h */; };
182-
636085141ED47BE600E8599E /* SentryFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 636085121ED47BE600E8599E /* SentryFileManager.m */; };
181+
636085131ED47BE600E8599E /* SentryFileManagerHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 636085111ED47BE600E8599E /* SentryFileManagerHelper.h */; };
182+
636085141ED47BE600E8599E /* SentryFileManagerHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 636085121ED47BE600E8599E /* SentryFileManagerHelper.m */; };
183183
6383953623ABA42C000C1594 /* SentryHttpTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = 6383953523ABA42C000C1594 /* SentryHttpTransport.h */; };
184184
638DC9A01EBC6B6400A66E41 /* SentryRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 638DC99E1EBC6B6400A66E41 /* SentryRequestOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
185185
638DC9A11EBC6B6400A66E41 /* SentryRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 638DC99F1EBC6B6400A66E41 /* SentryRequestOperation.m */; };
@@ -1118,6 +1118,7 @@
11181118
FAEC270E2DF3526000878871 /* SentryUserFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */; };
11191119
FAEC273D2DF3933A00878871 /* NSData+Unzip.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEC273C2DF3933200878871 /* NSData+Unzip.m */; };
11201120
FAEEBFE22E736D4B00E79CA9 /* SentryViewHierarchyProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEEBFDC2E736D4100E79CA9 /* SentryViewHierarchyProvider.swift */; };
1121+
FAEEBFEA2E74517B00E79CA9 /* SentryFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEEBFE92E74517800E79CA9 /* SentryFileManager.swift */; };
11211122
FAEEC0522E75E55F00E79CA9 /* SentrySerializationSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEEC04C2E75E55A00E79CA9 /* SentrySerializationSwift.swift */; };
11221123
FAEFA12F2E4FAE1900C431D9 /* SentrySDKSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEFA1292E4FAE1700C431D9 /* SentrySDKSettings.swift */; };
11231124
FAF120182E70C08F006E1DA3 /* SentryEnvelopeHeaderHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF120122E70C088006E1DA3 /* SentryEnvelopeHeaderHelper.h */; };
@@ -1417,8 +1418,8 @@
14171418
635B3F371EBC6E2500A6176D /* SentryAsynchronousOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryAsynchronousOperation.m; sourceTree = "<group>"; };
14181419
6360850B1ED2AFE100E8599E /* SentryBreadcrumb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryBreadcrumb.h; path = Public/SentryBreadcrumb.h; sourceTree = "<group>"; };
14191420
6360850C1ED2AFE100E8599E /* SentryBreadcrumb.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryBreadcrumb.m; sourceTree = "<group>"; };
1420-
636085111ED47BE600E8599E /* SentryFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryFileManager.h; path = include/SentryFileManager.h; sourceTree = "<group>"; };
1421-
636085121ED47BE600E8599E /* SentryFileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryFileManager.m; sourceTree = "<group>"; };
1421+
636085111ED47BE600E8599E /* SentryFileManagerHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryFileManagerHelper.h; path = include/SentryFileManagerHelper.h; sourceTree = "<group>"; };
1422+
636085121ED47BE600E8599E /* SentryFileManagerHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryFileManagerHelper.m; sourceTree = "<group>"; };
14221423
6383953523ABA42C000C1594 /* SentryHttpTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryHttpTransport.h; path = include/SentryHttpTransport.h; sourceTree = "<group>"; };
14231424
6387B82F1ED851970045A84C /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
14241425
638DC99E1EBC6B6400A66E41 /* SentryRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryRequestOperation.h; path = include/SentryRequestOperation.h; sourceTree = "<group>"; };
@@ -2463,6 +2464,7 @@
24632464
FAEC273C2DF3933200878871 /* NSData+Unzip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+Unzip.m"; sourceTree = "<group>"; };
24642465
FAEC273E2DF393E000878871 /* NSData+Unzip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+Unzip.h"; sourceTree = "<group>"; };
24652466
FAEEBFDC2E736D4100E79CA9 /* SentryViewHierarchyProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewHierarchyProvider.swift; sourceTree = "<group>"; };
2467+
FAEEBFE92E74517800E79CA9 /* SentryFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryFileManager.swift; sourceTree = "<group>"; };
24662468
FAEEC04C2E75E55A00E79CA9 /* SentrySerializationSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySerializationSwift.swift; sourceTree = "<group>"; };
24672469
FAEFA1292E4FAE1700C431D9 /* SentrySDKSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySDKSettings.swift; sourceTree = "<group>"; };
24682470
FAF120122E70C088006E1DA3 /* SentryEnvelopeHeaderHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryEnvelopeHeaderHelper.h; path = include/SentryEnvelopeHeaderHelper.h; sourceTree = "<group>"; };
@@ -2603,6 +2605,7 @@
26032605
FAE5797E2E7CF21300B710F9 /* SentryMigrateSessionInit.swift */,
26042606
62CB19242E77F8FD00AF5DA2 /* SentryDispatchSourceWrapper.swift */,
26052607
FAEEC04C2E75E55A00E79CA9 /* SentrySerializationSwift.swift */,
2608+
FAEEBFE92E74517800E79CA9 /* SentryFileManager.swift */,
26062609
FA94E7232E6F32FA00576666 /* SentryEnvelopeItemType.swift */,
26072610
FA458CBD2E691A6E0061B13D /* SentryProcessInfo.swift */,
26082611
F4A930222E65FDAF006DA6EF /* SentryMobileProvisionParser.swift */,
@@ -2897,10 +2900,10 @@
28972900
63AA769C1EB9C57A00D153DE /* SentryError.mm */,
28982901
7B42C47F27E08F33009B58C2 /* SentryDependencyContainer.h */,
28992902
7B42C48127E08F4B009B58C2 /* SentryDependencyContainer.m */,
2900-
636085111ED47BE600E8599E /* SentryFileManager.h */,
2903+
636085111ED47BE600E8599E /* SentryFileManagerHelper.h */,
29012904
FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */,
29022905
FA3734852E0F092F0091EF24 /* SentryDependencyContainerSwiftHelper.m */,
2903-
636085121ED47BE600E8599E /* SentryFileManager.m */,
2906+
636085121ED47BE600E8599E /* SentryFileManagerHelper.m */,
29042907
7BC3936725B1AB3E004F03D3 /* SentryLevelMapper.h */,
29052908
7BC3936D25B1AB72004F03D3 /* SentryLevelMapper.m */,
29062909
D8AE48B12C5786AA0092A2A6 /* SentryLogC.h */,
@@ -5203,7 +5206,7 @@
52035206
63AA76A51EB9CBC200D153DE /* SentryDsn.h in Headers */,
52045207
844EDD6C2949387000C86F34 /* SentryMetricProfiler.h in Headers */,
52055208
F452438A2DE65968003E8F50 /* ExceptionCatcher.h in Headers */,
5206-
636085131ED47BE600E8599E /* SentryFileManager.h in Headers */,
5209+
636085131ED47BE600E8599E /* SentryFileManagerHelper.h in Headers */,
52075210
7BD729962463E83300EA3610 /* SentryDateUtil.h in Headers */,
52085211
63FE707B20DA4C1000CDBAE8 /* SentryDictionaryDeepSearch.h in Headers */,
52095212
6344DDB91EC3115C00D9160D /* SentryCrashReportConverter.h in Headers */,
@@ -5859,6 +5862,7 @@
58595862
FAE57BF72E83049E00B710F9 /* SentryDisplayLinkWrapper.swift in Sources */,
58605863
D4CD2A802DE9F91900DA9F59 /* SentryRedactRegion.swift in Sources */,
58615864
D4CD2A812DE9F91900DA9F59 /* SentryRedactRegionType.swift in Sources */,
5865+
FAEEBFEA2E74517B00E79CA9 /* SentryFileManager.swift in Sources */,
58625866
6344DDB11EC308E400D9160D /* SentryCrashInstallationReporter.m in Sources */,
58635867
84BA62272CAE2EEF0049F636 /* SentryUserFeedbackWidgetButtonView.swift in Sources */,
58645868
FAE5798D2E7D9D4C00B710F9 /* SentrySysctl.swift in Sources */,
@@ -5945,7 +5949,7 @@
59455949
FAB3599A2E05D8080083D5E3 /* SentryEventSwiftHelper.m in Sources */,
59465950
F41362112E1C55AF00B84443 /* SentryScopePersistentStore+Tags.swift in Sources */,
59475951
7B4E375F258231FC00059C93 /* SentryAttachment.m in Sources */,
5948-
636085141ED47BE600E8599E /* SentryFileManager.m in Sources */,
5952+
636085141ED47BE600E8599E /* SentryFileManagerHelper.m in Sources */,
59495953
63FE710B20DA4C1000CDBAE8 /* SentryCrashMach.c in Sources */,
59505954
63FE707720DA4C1000CDBAE8 /* SentryDictionaryDeepSearch.m in Sources */,
59515955
FACEED132E3179A10007B4AC /* SentyOptionsInternal.m in Sources */,

SentryTestUtils/SentryFileManager+Test.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import "SentryFileManager.h"
1+
#import "SentryFileManagerHelper.h"
22

33
NS_ASSUME_NONNULL_BEGIN
44

@@ -11,11 +11,7 @@ NSString *_Nullable sentryBuildScopedCachesDirectoryPath(NSString *cachesDirecto
1111
SENTRY_EXTERN NSURL *_Nullable launchProfileConfigFileURL(void);
1212
SENTRY_EXTERN NSURL *_Nullable sentryLaunchConfigFileURL;
1313

14-
@interface SentryFileManager ()
15-
16-
@property (nonatomic, copy) NSString *eventsPath;
17-
@property (nonatomic, copy) NSString *envelopesPath;
18-
@property (nonatomic, copy) NSString *timezoneOffsetFilePath;
14+
@interface SentryFileManagerHelper ()
1915

2016
- (void)clearDiskState;
2117

SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#import "SentryDependencyContainer.h"
3535
#import "SentryDispatchFactory.h"
3636
#import "SentryFileManager+Test.h"
37+
#import "SentryFileManagerHelper.h"
3738
#import "SentryHub+Private.h"
3839
#import "SentryHub+Test.h"
3940
#import "SentryLogC.h"

SentryTestUtils/TestClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public class TestClient: SentryClient {
1616
)
1717
}
1818

19-
public override init?(options: Options, fileManager: SentryFileManager, deleteOldEnvelopeItems: Bool) {
19+
@_spi(Private) public override init?(options: Options, fileManager: SentryFileManager, deleteOldEnvelopeItems: Bool) {
2020
super.init(options: options, fileManager: fileManager, deleteOldEnvelopeItems: deleteOldEnvelopeItems, transportAdapter: TestTransportAdapter(transports: [TestTransport()], options: options))
2121
}
2222

23-
public override init(options: Options, fileManager: SentryFileManager, deleteOldEnvelopeItems: Bool, transportAdapter: SentryTransportAdapter) {
23+
@_spi(Private) public override init(options: Options, fileManager: SentryFileManager, deleteOldEnvelopeItems: Bool, transportAdapter: SentryTransportAdapter) {
2424
super.init(options: options, fileManager: fileManager, deleteOldEnvelopeItems: deleteOldEnvelopeItems, transportAdapter: transportAdapter)
2525
}
2626

SentryTestUtils/TestFileManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import _SentryPrivate
22
import Foundation
3-
@_spi(Private) import Sentry
3+
@_spi(Private) @testable import Sentry
44

5-
public class TestFileManager: SentryFileManager {
5+
@_spi(Private) public class TestFileManager: SentryFileManager {
66
var timestampLastInForeground: Date?
77
var readTimestampLastInForegroundInvocations: Int = 0
88
var storeTimestampLastInForegroundInvocations: Int = 0

Sources/Sentry/Processors/SentryWatchdogTerminationBreadcrumbProcessor.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#import "SentryWatchdogTerminationBreadcrumbProcessor.h"
2-
#import "SentryFileManager.h"
32
#import "SentryInternalDefines.h"
43
#import "SentryLogC.h"
54
#import "SentrySerialization.h"

Sources/Sentry/Profiling/SentryLaunchProfiling.m

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

55
# import "SentryContinuousProfiler.h"
66
# import "SentryDependencyContainer.h"
7-
# import "SentryFileManager.h"
7+
# import "SentryFileManagerHelper.h"
88
# import "SentryInternalDefines.h"
99
# import "SentryLaunchProfiling.h"
1010
# import "SentryLogC.h"

Sources/Sentry/Profiling/SentryProfilerTestHelpers.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
#if SENTRY_TARGET_PROFILING_SUPPORTED
44

5-
# import "SentryFileManager.h"
5+
# import "SentryFileManagerHelper.h"
66
# import "SentryInternalDefines.h"
77
# import "SentryLaunchProfiling.h"
88
# import "SentrySerialization.h"
9+
# import "SentrySwift.h"
910

1011
BOOL
1112
sentry_threadSanitizerIsPresent(void)

Sources/Sentry/SentryANRTrackingIntegration.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#import "SentryDependencyContainer.h"
55
#import "SentryEvent.h"
66
#import "SentryException.h"
7-
#import "SentryFileManager.h"
87
#import "SentryHub+Private.h"
98
#import "SentryLogC.h"
109
#import "SentryMechanism.h"

Sources/Sentry/SentryAppStateManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#import "SentryDependencyContainer.h"
33
#import "SentryNotificationNames.h"
44
#import <SentryAppStateManager.h>
5-
#import <SentryFileManager.h>
65
#import <SentryOptions.h>
76
#import <SentrySwift.h>
87

0 commit comments

Comments
 (0)