Skip to content

Commit f52beaa

Browse files
committed
Sentry extra packages Swift
1 parent 39f4c2a commit f52beaa

File tree

8 files changed

+42
-82
lines changed

8 files changed

+42
-82
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@
6969
15E0A8F22411A45A00F044E3 /* SentrySession.m in Sources */ = {isa = PBXBuildFile; fileRef = 15E0A8F12411A45A00F044E3 /* SentrySession.m */; };
7070
33042A0D29DAF79A00C60085 /* SentryExtraContextProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 33042A0C29DAF79A00C60085 /* SentryExtraContextProvider.m */; };
7171
33042A1729DC2C4300C60085 /* SentryExtraContextProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33042A1629DC2C4300C60085 /* SentryExtraContextProviderTests.swift */; };
72-
33C374B92D103F17004598F1 /* SentryExtraPackages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C374B82D103EE5004598F1 /* SentryExtraPackages.h */; settings = {ATTRIBUTES = (Private, ); }; };
73-
33C374BB2D103F4D004598F1 /* SentryExtraPackages.m in Sources */ = {isa = PBXBuildFile; fileRef = 33C374BA2D103F4A004598F1 /* SentryExtraPackages.m */; };
74-
33C374C02D104D6C004598F1 /* SentryExtraPackages.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B6D1262265F7CC600C9BE4B /* SentryExtraPackages.h */; settings = {ATTRIBUTES = (Private, ); }; };
7572
33C374C12D104D9C004598F1 /* SentrySdkPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C374BE2D104A41004598F1 /* SentrySdkPackage.h */; settings = {ATTRIBUTES = (Private, ); }; };
7673
33C374C22D104F60004598F1 /* SentrySdkPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 33C374BC2D104A31004598F1 /* SentrySdkPackage.m */; };
7774
33EB2A912C3412E4004FED3D /* SentryWithoutUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1068,6 +1065,7 @@
10681065
FA67DD182DDBD4EA00896B02 /* UIImageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCED2DDBD4EA00896B02 /* UIImageHelper.swift */; };
10691066
FA67DD192DDBD4EA00896B02 /* SwizzleClassNameExclude.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCD52DDBD4EA00896B02 /* SwizzleClassNameExclude.swift */; };
10701067
FA8A36182DEAA1EB0058D883 /* SentryThread+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */; };
1068+
FA90FAA82E06614E008CAAE8 /* SentryExtraPackages.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */; };
10711069
FAEC270E2DF3526000878871 /* SentryUserFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */; };
10721070
FAEC273D2DF3933A00878871 /* NSData+Unzip.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEC273C2DF3933200878871 /* NSData+Unzip.m */; };
10731071
/* End PBXBuildFile section */
@@ -1218,8 +1216,6 @@
12181216
33042A0B29DAF5F400C60085 /* SentryExtraContextProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryExtraContextProvider.h; sourceTree = "<group>"; };
12191217
33042A0C29DAF79A00C60085 /* SentryExtraContextProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryExtraContextProvider.m; sourceTree = "<group>"; };
12201218
33042A1629DC2C4300C60085 /* SentryExtraContextProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraContextProviderTests.swift; sourceTree = "<group>"; };
1221-
33C374B82D103EE5004598F1 /* SentryExtraPackages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryExtraPackages.h; path = include/SentryExtraPackages.h; sourceTree = "<group>"; };
1222-
33C374BA2D103F4A004598F1 /* SentryExtraPackages.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryExtraPackages.m; sourceTree = "<group>"; };
12231219
33C374BC2D104A31004598F1 /* SentrySdkPackage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySdkPackage.m; sourceTree = "<group>"; };
12241220
33C374BE2D104A41004598F1 /* SentrySdkPackage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySdkPackage.h; path = include/SentrySdkPackage.h; sourceTree = "<group>"; };
12251221
33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWithoutUIKit.h; path = Public/SentryWithoutUIKit.h; sourceTree = "<group>"; };
@@ -1606,7 +1602,6 @@
16061602
7B6C5F8626034395007F7DFF /* SentryWatchdogTerminationLogic.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationLogic.m; sourceTree = "<group>"; };
16071603
7B6CC50124EE5A42001816D7 /* SentryHubTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryHubTests.swift; sourceTree = "<group>"; };
16081604
7B6D1260265F784000C9BE4B /* PrivateSentrySDKOnly.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PrivateSentrySDKOnly.mm; sourceTree = "<group>"; };
1609-
7B6D1262265F7CC600C9BE4B /* SentryExtraPackages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryExtraPackages.h; path = ../../Sources/Sentry/include/SentryExtraPackages.h; sourceTree = "<group>"; };
16101605
7B6D135B27F4605D00331ED2 /* TestEnvelopeRateLimitDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestEnvelopeRateLimitDelegate.swift; sourceTree = "<group>"; };
16111606
7B6D98E724C6D336005502FA /* SentrySdkInfo+Equality.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentrySdkInfo+Equality.h"; sourceTree = "<group>"; };
16121607
7B6D98E824C6D336005502FA /* SentrySdkInfo+Equality.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "SentrySdkInfo+Equality.m"; sourceTree = "<group>"; };
@@ -2316,6 +2311,7 @@
23162311
FA67DCEF2DDBD4EA00896B02 /* URLSessionTaskHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionTaskHelper.swift; sourceTree = "<group>"; };
23172312
FA67DCF22DDBD4EA00896B02 /* SwiftDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDescriptor.swift; sourceTree = "<group>"; };
23182313
FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryThread+Private.h"; path = "include/SentryThread+Private.h"; sourceTree = "<group>"; };
2314+
FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraPackages.swift; sourceTree = "<group>"; };
23192315
FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUserFeedback.swift; sourceTree = "<group>"; };
23202316
FAEC273C2DF3933200878871 /* NSData+Unzip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+Unzip.m"; sourceTree = "<group>"; };
23212317
FAEC273E2DF393E000878871 /* NSData+Unzip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+Unzip.h"; sourceTree = "<group>"; };
@@ -2798,8 +2794,6 @@
27982794
D858FA652A29EAB3002A3503 /* SentryBinaryImageCache.m */,
27992795
D8739D152BEEA33F007D2F66 /* SentryLevelHelper.h */,
28002796
D8739D162BEEA33F007D2F66 /* SentryLevelHelper.m */,
2801-
33C374BA2D103F4A004598F1 /* SentryExtraPackages.m */,
2802-
33C374B82D103EE5004598F1 /* SentryExtraPackages.h */,
28032797
F452438B2DE65BC0003E8F50 /* SentryUseNSExceptionCallstackWrapper.h */,
28042798
F452437D2DE60B71003E8F50 /* SentryUseNSExceptionCallstackWrapper.m */,
28052799
);
@@ -2856,7 +2850,6 @@
28562850
7B0002312477F0520035FEF1 /* SentrySessionTests.m */,
28572851
63AA75951EB8AEDB00D153DE /* SentryTests.m */,
28582852
63AA75941EB8AEDB00D153DE /* Info.plist */,
2859-
7B6D1262265F7CC600C9BE4B /* SentryExtraPackages.h */,
28602853
7BAF3DB4243C743E008A5414 /* SentryClientTests.swift */,
28612854
A8AFFCD12907DA7600967CD7 /* SentryHttpStatusCodeRangeTests.swift */,
28622855
7B6CC50124EE5A42001816D7 /* SentryHubTests.swift */,
@@ -4490,6 +4483,7 @@
44904483
FA67DCCC2DDBD4EA00896B02 /* Helper */ = {
44914484
isa = PBXGroup;
44924485
children = (
4486+
FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */,
44934487
FA67DCC82DDBD4EA00896B02 /* Log */,
44944488
FA67DCC92DDBD4EA00896B02 /* SentryBaggageSerialization.swift */,
44954489
FA67DCCA2DDBD4EA00896B02 /* SentryCurrentDateProvider.swift */,
@@ -4629,7 +4623,6 @@
46294623
D8CB74152947246600A5F964 /* SentryEnvelopeAttachmentHeader.h in Headers */,
46304624
63FE71BA20DA4C1100CDBAE8 /* SentryCrashInstallation+Private.h in Headers */,
46314625
63FE71AE20DA4C1100CDBAE8 /* SentryCrashInstallation.h in Headers */,
4632-
33C374C02D104D6C004598F1 /* SentryExtraPackages.h in Headers */,
46334626
63FE70F120DA4C1000CDBAE8 /* SentryCrashMonitorType.h in Headers */,
46344627
7BA0C04628055F8E003E0326 /* SentryTransportAdapter.h in Headers */,
46354628
63FE717720DA4C1100CDBAE8 /* SentryCrashReportWriter.h in Headers */,
@@ -4713,7 +4706,6 @@
47134706
8EAE980B261E9F530073B6B3 /* SentryPerformanceTracker.h in Headers */,
47144707
63FE718520DA4C1100CDBAE8 /* SentryCrashC.h in Headers */,
47154708
8EA1ED0D2669028C00E62B98 /* SentryUIViewControllerSwizzling.h in Headers */,
4716-
33C374B92D103F17004598F1 /* SentryExtraPackages.h in Headers */,
47174709
D820CDB82BB1895F00BA339D /* SentrySessionReplayIntegration.h in Headers */,
47184710
F49D419C2DEA30C300D9244E /* SentryCrashExceptionApplicationHelper.h in Headers */,
47194711
7B98D7E425FB7A7200C5A389 /* SentryAppState.h in Headers */,
@@ -5244,6 +5236,7 @@
52445236
files = (
52455237
7BFC16A125249A9D00FF6266 /* SentryMessage.m in Sources */,
52465238
7BCFBD6F2681D0EE00BC27D8 /* SentryCrashScopeObserver.m in Sources */,
5239+
FA90FAA82E06614E008CAAE8 /* SentryExtraPackages.swift in Sources */,
52475240
7BD86ED1264A7CF6005439DB /* SentryAppStartMeasurement.m in Sources */,
52485241
7DC27EC723997EB7006998B5 /* SentryAutoBreadcrumbTrackingIntegration.m in Sources */,
52495242
D84D2CDF2C2BF9370011AF8A /* SentryReplayType.swift in Sources */,
@@ -5327,7 +5320,6 @@
53275320
63AA769E1EB9C57A00D153DE /* SentryError.mm in Sources */,
53285321
7B8713B026415B22006D6004 /* SentryAppStartTrackingIntegration.m in Sources */,
53295322
8E133FA225E72DEF00ABD0BF /* SentrySamplingContext.m in Sources */,
5330-
33C374BB2D103F4D004598F1 /* SentryExtraPackages.m in Sources */,
53315323
D81988C02BEBFFF70020E36C /* SentryReplayRecording.swift in Sources */,
53325324
7B6C5F8726034395007F7DFF /* SentryWatchdogTerminationLogic.m in Sources */,
53335325
7BBC827125DFD039005F1ED8 /* SentryInAppLogic.m in Sources */,

Sources/Resources/Sentry.modulemap

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

2929
header "SentrySdkInfo.h"
30-
header "SentryExtraPackages.h"
3130
header "SentrySdkPackage.h"
3231
header "SentryInternalSerializable.h"
3332

Sources/Sentry/PrivateSentrySDKOnly.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
#import "SentrySDK+Private.h"
1414
#import "SentrySerialization.h"
1515
#import "SentrySessionReplayIntegration+Private.h"
16+
#import "SentrySwift.h"
1617
#import "SentryThreadHandle.hpp"
1718
#import "SentryUser+Private.h"
1819
#import "SentryViewHierarchyProvider.h"
1920
#import <SentryBreadcrumb.h>
2021
#import <SentryDependencyContainer.h>
21-
#import <SentryExtraPackages.h>
2222
#import <SentryFramesTracker.h>
2323
#import <SentryScope+Private.h>
2424
#import <SentryScreenshot.h>

Sources/Sentry/SentryExtraPackages.m

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

Sources/Sentry/SentrySdkInfo.m

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

Sources/Sentry/include/SentryExtraPackages.h

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import Foundation
2+
3+
@objc @_spi(Private) public final class SentryExtraPackages: NSObject {
4+
private static var extraPackages = Set<[String: String]>()
5+
private static let syncQueue = DispatchQueue(label: "io.sentry.SentryExtraPackages.sync", attributes: .concurrent)
6+
7+
@objc
8+
public static func addPackageName(_ name: String?, version: String?) {
9+
guard let name, let version else {
10+
return
11+
}
12+
13+
let newPackage = ["name": name, "version": version]
14+
15+
syncQueue.async(flags: .barrier) {
16+
extraPackages.insert(newPackage)
17+
}
18+
}
19+
20+
@objc
21+
public static func getPackages() -> NSMutableSet {
22+
var copy: Set<[String: String]> = []
23+
syncQueue.sync {
24+
copy = extraPackages
25+
}
26+
return NSMutableSet(set: copy as NSSet)
27+
}
28+
29+
#if SENTRY_TEST || SENTRY_TEST_CI
30+
static func clear() {
31+
syncQueue.async(flags: .barrier) {
32+
extraPackages.removeAll()
33+
}
34+
}
35+
#endif
36+
}

Tests/SentryTests/Protocol/SentrySdkInfoTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@_spi(Private) @testable import Sentry
12
import SentryTestUtils
23
import XCTest
34

0 commit comments

Comments
 (0)