Skip to content

Commit c2982e7

Browse files
feat(SPM) Convert SentrySDK to Swift (#5683)
* feat(SPM) Covnert SentrySDK to Swift * PR feedback * swiftify the headerdocs (#5718) * Fix mac build * Fix test --------- Co-authored-by: Andrew McKnight <andrew.mcknight@sentry.io>
1 parent 53b722c commit c2982e7

23 files changed

+24056
-24500
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,6 @@
617617
7D0637032382B34300B30749 /* SentryScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D0637022382B34300B30749 /* SentryScope.h */; settings = {ATTRIBUTES = (Public, ); }; };
618618
7D082B8323C628790029866B /* SentryMeta.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D082B8023C628780029866B /* SentryMeta.m */; };
619619
7D0FCFB22379B915004DD83A /* SentryHub.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D0FCFB02379B915004DD83A /* SentryHub.h */; settings = {ATTRIBUTES = (Public, ); }; };
620-
7D427C62237B1D200046BAC8 /* SentrySDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D427C5F237B1D200046BAC8 /* SentrySDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
621620
7D5C441C237C2E1F00DAB0A3 /* SentryHub.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D5C4419237C2E1F00DAB0A3 /* SentryHub.m */; };
622621
7D65260E237F649E00113EA2 /* SentryScope.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D65260B237F649E00113EA2 /* SentryScope.m */; };
623622
7D7F0A5F23DF3D2C00A4629C /* SentryGlobalEventProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D7F0A5E23DF3D2C00A4629C /* SentryGlobalEventProcessor.h */; };
@@ -1061,7 +1060,6 @@
10611060
FA4C32972DF7513F001D7B00 /* SentryExperimentalOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4C32962DF7513F001D7B00 /* SentryExperimentalOptions.swift */; };
10621061
FA6555142E30181B009917BC /* SentrySDKInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = FA6555132E30181B009917BC /* SentrySDKInternal.h */; };
10631062
FA6555162E30182B009917BC /* SentrySDKInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = FA6555152E30182B009917BC /* SentrySDKInternal.m */; };
1064-
FA6555182E301833009917BC /* SentrySDKWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = FA6555172E301833009917BC /* SentrySDKWrapper.m */; };
10651063
FA65551A2E3018A3009917BC /* SentrySDKTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6555192E30189E009917BC /* SentrySDKTests.swift */; };
10661064
FA67DCC12DDBD4C800896B02 /* SentrySDKLog+Configure.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCC02DDBD4C800896B02 /* SentrySDKLog+Configure.swift */; };
10671065
FA67DCF52DDBD4EA00896B02 /* SentryCurrentDateProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCCA2DDBD4EA00896B02 /* SentryCurrentDateProvider.swift */; };
@@ -1110,6 +1108,8 @@
11101108
FAB359982E05D7E90083D5E3 /* SentryEventSwiftHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FAB359972E05D7E90083D5E3 /* SentryEventSwiftHelper.h */; };
11111109
FAB3599A2E05D8080083D5E3 /* SentryEventSwiftHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB359992E05D8080083D5E3 /* SentryEventSwiftHelper.m */; };
11121110
FAB7BBA92E2577A6007301E1 /* SentryModels+Serializable.h in Headers */ = {isa = PBXBuildFile; fileRef = FAB7BBA82E2577A2007301E1 /* SentryModels+Serializable.h */; };
1111+
FABE8E152E307A5E0040809A /* SentrySDK.swift in Sources */ = {isa = PBXBuildFile; fileRef = FABE8E142E307A5C0040809A /* SentrySDK.swift */; };
1112+
FABE8E172E307A7F0040809A /* Dependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = FABE8E162E307A7C0040809A /* Dependencies.swift */; };
11131113
FAC62B652E15A4100003909D /* SentrySDKThreadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC62B642E15A40C0003909D /* SentrySDKThreadTests.swift */; };
11141114
FAC735232E25AA81006C5A64 /* SentryProfilingSwiftHelpersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = FAC735222E25AA7A006C5A64 /* SentryProfilingSwiftHelpersTests.m */; };
11151115
FACEED132E3179A10007B4AC /* SentyOptionsInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = FACEED122E3179A10007B4AC /* SentyOptionsInternal.m */; };
@@ -1894,7 +1894,6 @@
18941894
7D0637022382B34300B30749 /* SentryScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryScope.h; path = Public/SentryScope.h; sourceTree = "<group>"; };
18951895
7D082B8023C628780029866B /* SentryMeta.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryMeta.m; sourceTree = "<group>"; };
18961896
7D0FCFB02379B915004DD83A /* SentryHub.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryHub.h; path = Public/SentryHub.h; sourceTree = "<group>"; };
1897-
7D427C5F237B1D200046BAC8 /* SentrySDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySDK.h; path = Public/SentrySDK.h; sourceTree = "<group>"; };
18981897
7D5C4419237C2E1F00DAB0A3 /* SentryHub.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryHub.m; sourceTree = "<group>"; };
18991898
7D65260B237F649E00113EA2 /* SentryScope.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryScope.m; sourceTree = "<group>"; };
19001899
7D7F0A5E23DF3D2C00A4629C /* SentryGlobalEventProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryGlobalEventProcessor.h; path = include/SentryGlobalEventProcessor.h; sourceTree = "<group>"; };
@@ -2398,7 +2397,6 @@
23982397
FA4C32962DF7513F001D7B00 /* SentryExperimentalOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExperimentalOptions.swift; sourceTree = "<group>"; };
23992398
FA6555132E30181B009917BC /* SentrySDKInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySDKInternal.h; path = include/SentrySDKInternal.h; sourceTree = "<group>"; };
24002399
FA6555152E30182B009917BC /* SentrySDKInternal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySDKInternal.m; sourceTree = "<group>"; };
2401-
FA6555172E301833009917BC /* SentrySDKWrapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySDKWrapper.m; sourceTree = "<group>"; };
24022400
FA6555192E30189E009917BC /* SentrySDKTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySDKTests.swift; sourceTree = "<group>"; };
24032401
FA67DCC02DDBD4C800896B02 /* SentrySDKLog+Configure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentrySDKLog+Configure.swift"; sourceTree = "<group>"; };
24042402
FA67DCC22DDBD4EA00896B02 /* Locks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Locks.swift; sourceTree = "<group>"; };
@@ -2447,6 +2445,8 @@
24472445
FAB359972E05D7E90083D5E3 /* SentryEventSwiftHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryEventSwiftHelper.h; path = include/SentryEventSwiftHelper.h; sourceTree = "<group>"; };
24482446
FAB359992E05D8080083D5E3 /* SentryEventSwiftHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryEventSwiftHelper.m; sourceTree = "<group>"; };
24492447
FAB7BBA82E2577A2007301E1 /* SentryModels+Serializable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryModels+Serializable.h"; path = "include/SentryModels+Serializable.h"; sourceTree = "<group>"; };
2448+
FABE8E142E307A5C0040809A /* SentrySDK.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySDK.swift; sourceTree = "<group>"; };
2449+
FABE8E162E307A7C0040809A /* Dependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dependencies.swift; sourceTree = "<group>"; };
24502450
FAC62B642E15A40C0003909D /* SentrySDKThreadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySDKThreadTests.swift; sourceTree = "<group>"; };
24512451
FAC735222E25AA7A006C5A64 /* SentryProfilingSwiftHelpersTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryProfilingSwiftHelpersTests.m; sourceTree = "<group>"; };
24522452
FACEED122E3179A10007B4AC /* SentyOptionsInternal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentyOptionsInternal.m; sourceTree = "<group>"; };
@@ -2586,6 +2586,8 @@
25862586
621D9F2D2B9B030E003D94DE /* Helper */ = {
25872587
isa = PBXGroup;
25882588
children = (
2589+
FABE8E162E307A7C0040809A /* Dependencies.swift */,
2590+
FABE8E142E307A5C0040809A /* SentrySDK.swift */,
25892591
FA3A42712E1C5F9B00A08C39 /* SentryNSNotificationCenterWrapper.swift */,
25902592
FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */,
25912593
FA8E58F02E0AD4220049F69D /* SentryDispatchQueueWrapper.swift */,
@@ -3070,8 +3072,6 @@
30703072
63AA75ED1EB8B3C400D153DE /* SentryClient.m */,
30713073
7B85DC1C24EFAFCD007D01D2 /* SentryClient+Private.h */,
30723074
92EC54CD2E1EB54B00A10AC2 /* SentryClient+Logs.h */,
3073-
7D427C5F237B1D200046BAC8 /* SentrySDK.h */,
3074-
FA6555172E301833009917BC /* SentrySDKWrapper.m */,
30753075
7B610D5E2512390E00B0B5D9 /* SentrySDK+Private.h */,
30763076
FA6555132E30181B009917BC /* SentrySDKInternal.h */,
30773077
FA6555152E30182B009917BC /* SentrySDKInternal.m */,
@@ -5085,7 +5085,6 @@
50855085
63FE710920DA4C1000CDBAE8 /* SentryCrashFileUtils.h in Headers */,
50865086
D865892F29D6ECA7000BE151 /* SentryCrashBinaryImageCache.h in Headers */,
50875087
6344DDB41EC309E000D9160D /* SentryCrashReportSink.h in Headers */,
5088-
7D427C62237B1D200046BAC8 /* SentrySDK.h in Headers */,
50895088
D8C66A362A77B1F70015696A /* SentryPropagationContext.h in Headers */,
50905089
D867063F27C3BC2400048851 /* SentryCoreDataTracker.h in Headers */,
50915090
7B6C5EDA264E8D860010D138 /* SentryFramesTrackingIntegration.h in Headers */,
@@ -5633,7 +5632,6 @@
56335632
92ECD73C2E05ACE00063EC10 /* SentryLog.swift in Sources */,
56345633
F458D1152E1869AD0028273E /* SentryScopePersistentStore+String.swift in Sources */,
56355634
F458D1172E186DF20028273E /* SentryScopePersistentStore+Fingerprint.swift in Sources */,
5636-
FA6555182E301833009917BC /* SentrySDKWrapper.m in Sources */,
56375635
D8CB7417294724CC00A5F964 /* SentryEnvelopeAttachmentHeader.m in Sources */,
56385636
D84793262788737D00BE8E99 /* SentryByteCountFormatter.m in Sources */,
56395637
63AA769E1EB9C57A00D153DE /* SentryError.mm in Sources */,
@@ -5741,6 +5739,7 @@
57415739
FA67DCFC2DDBD4EA00896B02 /* SentryFramesDelayResult.swift in Sources */,
57425740
FA67DCFD2DDBD4EA00896B02 /* SentryANRTracker.swift in Sources */,
57435741
FA67DCFE2DDBD4EA00896B02 /* SentryANRTrackerV2Delegate.swift in Sources */,
5742+
FABE8E152E307A5E0040809A /* SentrySDK.swift in Sources */,
57445743
FA67DCFF2DDBD4EA00896B02 /* SentryMXManager.swift in Sources */,
57455744
D41415A72DEEE532003B14D5 /* SentryRedactViewHelper.swift in Sources */,
57465745
FA67DD002DDBD4EA00896B02 /* SentryMaskRenderer.swift in Sources */,
@@ -5778,6 +5777,7 @@
57785777
6344DDBA1EC3115C00D9160D /* SentryCrashReportConverter.m in Sources */,
57795778
63FE70FD20DA4C1000CDBAE8 /* SentryCrashCachedData.c in Sources */,
57805779
A8F17B2E2901765900990B25 /* SentryRequest.m in Sources */,
5780+
FABE8E172E307A7F0040809A /* Dependencies.swift in Sources */,
57815781
7BE1E33424F7E3CB009D3AD0 /* SentryMigrateSessionInit.m in Sources */,
57825782
D80299502BA83A88000F0081 /* SentryPixelBuffer.swift in Sources */,
57835783
15E0A8F22411A45A00F044E3 /* SentrySession.m in Sources */,

SentryTestUtils/TestClient.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ public class TestClient: SentryClient {
125125
captureFeedbackInvocations.record((feedback, scope))
126126
}
127127

128+
public var captureSerializedFeedbackInvocations = Invocations<(String, Scope)>()
129+
public override func captureSerializedFeedback(_ serializedFeedback: [AnyHashable: Any], withEventId feedbackEventId: String, attachments: [Attachment], scope: Scope) {
130+
captureSerializedFeedbackInvocations.record((feedbackEventId, scope))
131+
}
132+
128133
public var captureEnvelopeInvocations = Invocations<SentryEnvelope>()
129134
public override func capture(_ envelope: SentryEnvelope) {
130135
captureEnvelopeInvocations.record(envelope)

Sources/Sentry/Public/Sentry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[];
3434
# import <Sentry/SentryOptions.h>
3535
# import <Sentry/SentryReplayApi.h>
3636
# import <Sentry/SentryRequest.h>
37-
# import <Sentry/SentrySDK.h>
3837
# import <Sentry/SentrySampleDecision.h>
3938
# import <Sentry/SentrySamplingContext.h>
4039
# import <Sentry/SentryScope.h>

0 commit comments

Comments
 (0)