Skip to content

Commit 3279d4e

Browse files
authored
Sentry SDK Info in Swift (#5481)
1 parent 75b23cd commit 3279d4e

19 files changed

+288
-275
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,6 @@
455455
7B8713B426415BAA006D6004 /* SentryAppStartTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8713B326415BAA006D6004 /* SentryAppStartTracker.m */; };
456456
7B87C916295ECFD700510C52 /* SentryMetricKitEventTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87C915295ECFD700510C52 /* SentryMetricKitEventTests.swift */; };
457457
7B883F49253D714C00879E62 /* SentryCrashUUIDConversion.c in Sources */ = {isa = PBXBuildFile; fileRef = 7B883F48253D714C00879E62 /* SentryCrashUUIDConversion.c */; };
458-
7B88F2FE24BC5A4C00ADF90A /* SentrySdkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
459-
7B88F30024BC5A7D00ADF90A /* SentrySdkInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */; };
460458
7B88F30224BC5C6D00ADF90A /* SentrySdkInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F30124BC5C6D00ADF90A /* SentrySdkInfoTests.swift */; };
461459
7B88F30424BC8E6500ADF90A /* SentrySerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F30324BC8E6500ADF90A /* SentrySerializationTests.swift */; };
462460
7B8CA85726DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8CA85626DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift */; };
@@ -1049,6 +1047,7 @@
10491047
F4FE9DFE2E622CD70014FED5 /* SentryObjCRuntimeWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FE9DFC2E622CD70014FED5 /* SentryObjCRuntimeWrapper.swift */; };
10501048
F4FE9DBD2E621F100014FED5 /* SentryRandom.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FE9DBC2E621F100014FED5 /* SentryRandom.swift */; };
10511049
FA034AC82DD3DB4900FE3107 /* SentryIntegrationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = FA034AC72DD3DB4900FE3107 /* SentryIntegrationProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
1050+
FA21A2EF2E60E9CB00E7EADB /* EnvelopeComparison.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA21A2E92E60E9C700E7EADB /* EnvelopeComparison.swift */; };
10521051
FA21F0B42E4A2A80008B4E5A /* SentryAppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4C32972DF7513F001D7B01 /* SentryAppState.swift */; };
10531052
FA3734822E0EEA670091EF24 /* SentryScreenshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA3734812E0EEA670091EF24 /* SentryScreenshot.swift */; };
10541053
FA3734842E0F086C0091EF24 /* SentryDependencyContainerSwiftHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */; };
@@ -1097,6 +1096,7 @@
10971096
FA67DD182DDBD4EA00896B02 /* UIImageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCED2DDBD4EA00896B02 /* UIImageHelper.swift */; };
10981097
FA67DD192DDBD4EA00896B02 /* SwizzleClassNameExclude.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCD52DDBD4EA00896B02 /* SwizzleClassNameExclude.swift */; };
10991098
FA6FC0A32E0B5ACE00ED2669 /* SentrySdkPackage.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */; };
1099+
FA6FC0AA2E0B6B1100ED2669 /* SentrySdkInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6FC0A92E0B6B0E00ED2669 /* SentrySdkInfo.swift */; };
11001100
FA7206DF2E0B37850072FDD4 /* SentryProfileCollector.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7206DE2E0B37780072FDD4 /* SentryProfileCollector.h */; };
11011101
FA7206E12E0B37C80072FDD4 /* SentryProfileCollector.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */; };
11021102
FA8A36182DEAA1EB0058D883 /* SentryThread+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */; };
@@ -1714,8 +1714,6 @@
17141714
7B8713B326415BAA006D6004 /* SentryAppStartTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryAppStartTracker.m; sourceTree = "<group>"; };
17151715
7B87C915295ECFD700510C52 /* SentryMetricKitEventTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMetricKitEventTests.swift; sourceTree = "<group>"; };
17161716
7B883F48253D714C00879E62 /* SentryCrashUUIDConversion.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SentryCrashUUIDConversion.c; sourceTree = "<group>"; };
1717-
7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySdkInfo.h; path = include/SentrySdkInfo.h; sourceTree = "<group>"; };
1718-
7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySdkInfo.m; sourceTree = "<group>"; };
17191717
7B88F30124BC5C6D00ADF90A /* SentrySdkInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkInfoTests.swift; sourceTree = "<group>"; };
17201718
7B88F30324BC8E6500ADF90A /* SentrySerializationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySerializationTests.swift; sourceTree = "<group>"; };
17211719
7B8CA85626DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNetworkTrackerIntegrationTests.swift; sourceTree = "<group>"; };
@@ -2393,6 +2391,7 @@
23932391
F4FE9DFC2E622CD70014FED5 /* SentryObjCRuntimeWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryObjCRuntimeWrapper.swift; sourceTree = "<group>"; };
23942392
F4FE9DBC2E621F100014FED5 /* SentryRandom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryRandom.swift; sourceTree = "<group>"; };
23952393
FA034AC72DD3DB4900FE3107 /* SentryIntegrationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryIntegrationProtocol.h; path = Public/SentryIntegrationProtocol.h; sourceTree = "<group>"; };
2394+
FA21A2E92E60E9C700E7EADB /* EnvelopeComparison.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnvelopeComparison.swift; sourceTree = "<group>"; };
23962395
FA3734812E0EEA670091EF24 /* SentryScreenshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScreenshot.swift; sourceTree = "<group>"; };
23972396
FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDependencyContainerSwiftHelper.h; path = include/SentryDependencyContainerSwiftHelper.h; sourceTree = "<group>"; };
23982397
FA3734852E0F092F0091EF24 /* SentryDependencyContainerSwiftHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDependencyContainerSwiftHelper.m; sourceTree = "<group>"; };
@@ -2441,6 +2440,7 @@
24412440
FA67DCEF2DDBD4EA00896B02 /* URLSessionTaskHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionTaskHelper.swift; sourceTree = "<group>"; };
24422441
FA67DCF22DDBD4EA00896B02 /* SwiftDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDescriptor.swift; sourceTree = "<group>"; };
24432442
FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkPackage.swift; sourceTree = "<group>"; };
2443+
FA6FC0A92E0B6B0E00ED2669 /* SentrySdkInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkInfo.swift; sourceTree = "<group>"; };
24442444
FA7206DE2E0B37780072FDD4 /* SentryProfileCollector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryProfileCollector.h; sourceTree = "<group>"; };
24452445
FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfileCollector.mm; sourceTree = "<group>"; };
24462446
FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryThread+Private.h"; path = "include/SentryThread+Private.h"; sourceTree = "<group>"; };
@@ -2599,6 +2599,7 @@
25992599
F4FE9DBC2E621F100014FED5 /* SentryRandom.swift */,
26002600
F48F767B2E60B555009D4E7D /* SentryNSTimerFactory.swift */,
26012601
FABE8E162E307A7C0040809A /* Dependencies.swift */,
2602+
FA6FC0A92E0B6B0E00ED2669 /* SentrySdkInfo.swift */,
26022603
FABE8E142E307A5C0040809A /* SentrySDK.swift */,
26032604
FA3A42712E1C5F9B00A08C39 /* SentryNSNotificationCenterWrapper.swift */,
26042605
FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */,
@@ -2721,8 +2722,6 @@
27212722
7B4E24FB251C97B400060D68 /* SentrySession.h */,
27222723
15E0A8F12411A45A00F044E3 /* SentrySession.m */,
27232724
7BE1E32624F7AE08009D3AD0 /* SentrySession+Private.h */,
2724-
7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */,
2725-
7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */,
27262725
7BFC169A2524995700FF6266 /* SentryMessage.h */,
27272726
7BFC16A025249A9D00FF6266 /* SentryMessage.m */,
27282727
7B4E375425822C4500059C93 /* SentryAttachment.h */,
@@ -3581,6 +3580,7 @@
35813580
62F05D292C0DB1C800916E3F /* SentryLogTestHelper.h */,
35823581
62F05D2A2C0DB1F100916E3F /* SentryLogTestHelper.m */,
35833582
7BBD18BA24530D2600427C76 /* SentryFileManagerTests.swift */,
3583+
FA21A2E92E60E9C700E7EADB /* EnvelopeComparison.swift */,
35843584
7BD4E8E727FD95900086C410 /* SentryMigrateSessionInitTests.m */,
35853585
7BD4E8E527FD84480086C410 /* TestFileManagerDelegate.swift */,
35863586
631501BA1EE6F30B00512C5B /* SentrySwizzleTests.m */,
@@ -4909,7 +4909,6 @@
49094909
63FE717720DA4C1100CDBAE8 /* SentryCrashReportWriter.h in Headers */,
49104910
84DEE86B2B686BD400A7BC17 /* SentrySamplerDecision.h in Headers */,
49114911
7B4E23BE251A2BD500060D68 /* SentryCrashIntegrationSessionHandler.h in Headers */,
4912-
7B88F2FE24BC5A4C00ADF90A /* SentrySdkInfo.h in Headers */,
49134912
D4291A692DD61A3F00772088 /* SentryDispatchQueueProviderProtocol.h in Headers */,
49144913
7BCFBD672681C95000BC27D8 /* SentryScopeObserver.h in Headers */,
49154914
D81A346C291AECC7005A27A9 /* PrivateSentrySDKOnly.h in Headers */,
@@ -5589,6 +5588,7 @@
55895588
7B6438AB26A70F24000D0F65 /* UIViewController+Sentry.m in Sources */,
55905589
84302A812B5767A50027A629 /* SentryLaunchProfiling.m in Sources */,
55915590
63AA76A31EB9CBAA00D153DE /* SentryDsn.m in Sources */,
5591+
FA6FC0AA2E0B6B1100ED2669 /* SentrySdkInfo.swift in Sources */,
55925592
84DBC62C2CE82F12000C4904 /* SentryFeedback.swift in Sources */,
55935593
F41362132E1C566100B84443 /* SentryScopePersistentStore+User.swift in Sources */,
55945594
63B818FA1EC34639002FDF4C /* SentryDebugMeta.m in Sources */,
@@ -5634,7 +5634,6 @@
56345634
7BA0C0482805600A003E0326 /* SentryTransportAdapter.m in Sources */,
56355635
63FE712920DA4C1000CDBAE8 /* SentryCrashCPU_arm.c in Sources */,
56365636
03F84D3427DD4191008FE43F /* SentryThreadMetadataCache.cpp in Sources */,
5637-
7B88F30024BC5A7D00ADF90A /* SentrySdkInfo.m in Sources */,
56385637
62862B1E2B1DDC35009B16E3 /* SentryDelayedFrame.m in Sources */,
56395638
84AC61D729F75A98009EEF61 /* SentryDispatchFactory.m in Sources */,
56405639
15360CD62432832400112302 /* SentryAutoSessionTrackingIntegration.m in Sources */,
@@ -6062,6 +6061,7 @@
60626061
D4F2B5352D0C69D500649E42 /* SentryCrashCTests.swift in Sources */,
60636062
7B56D73524616E5600B842DA /* SentryConcurrentRateLimitsDictionaryTests.swift in Sources */,
60646063
7B7D8730248648AD00D2ECFF /* SentryStacktraceBuilderTests.swift in Sources */,
6064+
FA21A2EF2E60E9CB00E7EADB /* EnvelopeComparison.swift in Sources */,
60656065
62E081AB29ED4322000F69FC /* SentryBreadcrumbTestDelegate.swift in Sources */,
60666066
D8751FA5274743710032F4DE /* SentryNSURLSessionTaskSearchTests.swift in Sources */,
60676067
D86F419827C8FEFA00490520 /* SentryCoreDataTrackerExtension.swift in Sources */,

Sources/Resources/Sentry.modulemap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ framework module Sentry {
2525
header "SentrySessionReplayIntegration.h"
2626
header "SentrySessionReplayIntegration-Hybrid.h"
2727

28-
header "SentrySdkInfo.h"
2928
header "SentryInternalSerializable.h"
3029

3130
export *

Sources/Sentry/SentryClient.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#import "SentrySDK+Private.h"
3333
#import "SentryScope+Private.h"
3434
#import "SentryScope+PrivateSwift.h"
35-
#import "SentrySdkInfo.h"
3635
#import "SentrySerialization.h"
3736
#import "SentrySession.h"
3837
#import "SentryStacktraceBuilder.h"
@@ -572,8 +571,11 @@ - (void)captureReplayEvent:(SentryReplayEvent *)replayEvent
572571

573572
// Hybrid SDKs may override the sdk info for a replay Event,
574573
// the same SDK should be used for the envelope header.
574+
#pragma clang diagnostic push
575+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
575576
SentrySdkInfo *sdkInfo = replayEvent.sdk ? [[SentrySdkInfo alloc] initWithDict:replayEvent.sdk]
576577
: [SentrySdkInfo global];
578+
#pragma clang diagnotsic pop
577579
SentryEnvelopeHeader *envelopeHeader =
578580
[[SentryEnvelopeHeader alloc] initWithId:replayEvent.eventId
579581
sdkInfo:sdkInfo

Sources/Sentry/SentryEnvelope.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#import "SentryLogC.h"
1212
#import "SentryMessage.h"
1313
#import "SentryMsgPackSerializer.h"
14-
#import "SentrySdkInfo.h"
1514
#import "SentrySerialization.h"
1615
#import "SentrySession.h"
1716
#import "SentrySwift.h"
@@ -31,7 +30,10 @@ - (instancetype)initWithId:(SentryId *_Nullable)eventId
3130
- (instancetype)initWithId:(nullable SentryId *)eventId
3231
traceContext:(nullable SentryTraceContext *)traceContext
3332
{
33+
#pragma clang diagnostic push
34+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
3435
SentrySdkInfo *sdkInfo = [SentrySdkInfo global];
36+
#pragma clang diagnostic pop
3537
self = [self initWithId:eventId sdkInfo:sdkInfo traceContext:traceContext];
3638
return self;
3739
}

Sources/Sentry/SentryHub.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ - (void)unregisterSessionListener:(id<SentrySessionListener>)listener
854854

855855
#pragma mark - Protected
856856

857-
- (NSMutableArray<NSString *> *)trimmedInstalledIntegrationNames
857+
- (NSArray<NSString *> *)trimmedInstalledIntegrationNames
858858
{
859859
NSMutableArray<NSString *> *integrations = [NSMutableArray<NSString *> array];
860860
for (NSString *integration in SentrySDKInternal.currentHub.installedIntegrationNames) {

Sources/Sentry/SentrySdkInfo.m

Lines changed: 0 additions & 146 deletions
This file was deleted.

Sources/Sentry/SentrySerialization.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#import "SentryLevelMapper.h"
99
#import "SentryLogC.h"
1010
#import "SentryModels+Serializable.h"
11-
#import "SentrySdkInfo.h"
1211
#import "SentrySession.h"
1312
#import "SentrySwift.h"
1413
#import "SentryTraceContext.h"

Sources/Sentry/include/SentryHub+Private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
3434
* Every integration starts with "Sentry" and ends with "Integration". To keep the payload of the
3535
* event small we remove both.
3636
*/
37-
- (NSMutableArray<NSString *> *)trimmedInstalledIntegrationNames;
37+
- (NSArray<NSString *> *)trimmedInstalledIntegrationNames;
3838

3939
- (void)addInstalledIntegration:(id<SentryIntegrationProtocol>)integration name:(NSString *)name;
4040
- (void)removeAllIntegrations;

Sources/Sentry/include/SentryPrivate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#import "SentryCrashExceptionApplicationHelper.h"
88
#import "SentryCrashUUIDConversion.h"
99
#import "SentryEventSwiftHelper.h"
10+
#import "SentryHub+Private.h"
1011
#import "SentryNSDataUtils.h"
12+
#import "SentrySDK+Private.h"
1113
#import "SentryTime.h"
1214
#import "SentryUserAccess.h"
1315
#import "_SentryDispatchQueueWrapperInternal.h"

0 commit comments

Comments
 (0)