Skip to content

Commit c8ec1ac

Browse files
committed
Sentry extra packages Swift
1 parent 8ea5293 commit c8ec1ac

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, ); }; };
@@ -1072,6 +1069,7 @@
10721069
FA8A36182DEAA1EB0058D883 /* SentryThread+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */; };
10731070
FA90FAFD2E070A3B008CAAE8 /* SentryURLRequestFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90FAFC2E070A3B008CAAE8 /* SentryURLRequestFactory.swift */; };
10741071
FAB359982E05D7E90083D5E3 /* SentryEventSwiftHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FAB359972E05D7E90083D5E3 /* SentryEventSwiftHelper.h */; };
1072+
FA90FAA82E06614E008CAAE8 /* SentryExtraPackages.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */; };
10751073
FAB3599A2E05D8080083D5E3 /* SentryEventSwiftHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB359992E05D8080083D5E3 /* SentryEventSwiftHelper.m */; };
10761074
FAEC270E2DF3526000878871 /* SentryUserFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */; };
10771075
FAEC273D2DF3933A00878871 /* NSData+Unzip.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEC273C2DF3933200878871 /* NSData+Unzip.m */; };
@@ -1223,8 +1221,6 @@
12231221
33042A0B29DAF5F400C60085 /* SentryExtraContextProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryExtraContextProvider.h; sourceTree = "<group>"; };
12241222
33042A0C29DAF79A00C60085 /* SentryExtraContextProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryExtraContextProvider.m; sourceTree = "<group>"; };
12251223
33042A1629DC2C4300C60085 /* SentryExtraContextProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraContextProviderTests.swift; sourceTree = "<group>"; };
1226-
33C374B82D103EE5004598F1 /* SentryExtraPackages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryExtraPackages.h; path = include/SentryExtraPackages.h; sourceTree = "<group>"; };
1227-
33C374BA2D103F4A004598F1 /* SentryExtraPackages.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryExtraPackages.m; sourceTree = "<group>"; };
12281224
33C374BC2D104A31004598F1 /* SentrySdkPackage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySdkPackage.m; sourceTree = "<group>"; };
12291225
33C374BE2D104A41004598F1 /* SentrySdkPackage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySdkPackage.h; path = include/SentrySdkPackage.h; sourceTree = "<group>"; };
12301226
33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWithoutUIKit.h; path = Public/SentryWithoutUIKit.h; sourceTree = "<group>"; };
@@ -1609,7 +1605,6 @@
16091605
7B6C5F8626034395007F7DFF /* SentryWatchdogTerminationLogic.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationLogic.m; sourceTree = "<group>"; };
16101606
7B6CC50124EE5A42001816D7 /* SentryHubTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryHubTests.swift; sourceTree = "<group>"; };
16111607
7B6D1260265F784000C9BE4B /* PrivateSentrySDKOnly.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PrivateSentrySDKOnly.mm; sourceTree = "<group>"; };
1612-
7B6D1262265F7CC600C9BE4B /* SentryExtraPackages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryExtraPackages.h; path = ../../Sources/Sentry/include/SentryExtraPackages.h; sourceTree = "<group>"; };
16131608
7B6D135B27F4605D00331ED2 /* TestEnvelopeRateLimitDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestEnvelopeRateLimitDelegate.swift; sourceTree = "<group>"; };
16141609
7B6D98E724C6D336005502FA /* SentrySdkInfo+Equality.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentrySdkInfo+Equality.h"; sourceTree = "<group>"; };
16151610
7B6D98E824C6D336005502FA /* SentrySdkInfo+Equality.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "SentrySdkInfo+Equality.m"; sourceTree = "<group>"; };
@@ -2325,6 +2320,7 @@
23252320
FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryThread+Private.h"; path = "include/SentryThread+Private.h"; sourceTree = "<group>"; };
23262321
FA90FAFC2E070A3B008CAAE8 /* SentryURLRequestFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryURLRequestFactory.swift; sourceTree = "<group>"; };
23272322
FAB359972E05D7E90083D5E3 /* SentryEventSwiftHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryEventSwiftHelper.h; path = include/SentryEventSwiftHelper.h; sourceTree = "<group>"; };
2323+
FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraPackages.swift; sourceTree = "<group>"; };
23282324
FAB359992E05D8080083D5E3 /* SentryEventSwiftHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryEventSwiftHelper.m; sourceTree = "<group>"; };
23292325
FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUserFeedback.swift; sourceTree = "<group>"; };
23302326
FAEC273C2DF3933200878871 /* NSData+Unzip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+Unzip.m"; sourceTree = "<group>"; };
@@ -2808,8 +2804,6 @@
28082804
D858FA652A29EAB3002A3503 /* SentryBinaryImageCache.m */,
28092805
D8739D152BEEA33F007D2F66 /* SentryLevelHelper.h */,
28102806
D8739D162BEEA33F007D2F66 /* SentryLevelHelper.m */,
2811-
33C374BA2D103F4A004598F1 /* SentryExtraPackages.m */,
2812-
33C374B82D103EE5004598F1 /* SentryExtraPackages.h */,
28132807
F452438B2DE65BC0003E8F50 /* SentryUseNSExceptionCallstackWrapper.h */,
28142808
F452437D2DE60B71003E8F50 /* SentryUseNSExceptionCallstackWrapper.m */,
28152809
);
@@ -2866,7 +2860,6 @@
28662860
7B0002312477F0520035FEF1 /* SentrySessionTests.m */,
28672861
63AA75951EB8AEDB00D153DE /* SentryTests.m */,
28682862
63AA75941EB8AEDB00D153DE /* Info.plist */,
2869-
7B6D1262265F7CC600C9BE4B /* SentryExtraPackages.h */,
28702863
7BAF3DB4243C743E008A5414 /* SentryClientTests.swift */,
28712864
A8AFFCD12907DA7600967CD7 /* SentryHttpStatusCodeRangeTests.swift */,
28722865
7B6CC50124EE5A42001816D7 /* SentryHubTests.swift */,
@@ -4505,6 +4498,7 @@
45054498
FA67DCCC2DDBD4EA00896B02 /* Helper */ = {
45064499
isa = PBXGroup;
45074500
children = (
4501+
FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */,
45084502
FA67DCC82DDBD4EA00896B02 /* Log */,
45094503
FA67DCC92DDBD4EA00896B02 /* SentryBaggageSerialization.swift */,
45104504
FA67DCCA2DDBD4EA00896B02 /* SentryCurrentDateProvider.swift */,
@@ -4644,7 +4638,6 @@
46444638
D8CB74152947246600A5F964 /* SentryEnvelopeAttachmentHeader.h in Headers */,
46454639
63FE71BA20DA4C1100CDBAE8 /* SentryCrashInstallation+Private.h in Headers */,
46464640
63FE71AE20DA4C1100CDBAE8 /* SentryCrashInstallation.h in Headers */,
4647-
33C374C02D104D6C004598F1 /* SentryExtraPackages.h in Headers */,
46484641
63FE70F120DA4C1000CDBAE8 /* SentryCrashMonitorType.h in Headers */,
46494642
7BA0C04628055F8E003E0326 /* SentryTransportAdapter.h in Headers */,
46504643
63FE717720DA4C1100CDBAE8 /* SentryCrashReportWriter.h in Headers */,
@@ -4729,7 +4722,6 @@
47294722
8EAE980B261E9F530073B6B3 /* SentryPerformanceTracker.h in Headers */,
47304723
63FE718520DA4C1100CDBAE8 /* SentryCrashC.h in Headers */,
47314724
8EA1ED0D2669028C00E62B98 /* SentryUIViewControllerSwizzling.h in Headers */,
4732-
33C374B92D103F17004598F1 /* SentryExtraPackages.h in Headers */,
47334725
D820CDB82BB1895F00BA339D /* SentrySessionReplayIntegration.h in Headers */,
47344726
F49D419C2DEA30C300D9244E /* SentryCrashExceptionApplicationHelper.h in Headers */,
47354727
7B98D7E425FB7A7200C5A389 /* SentryAppState.h in Headers */,
@@ -5262,6 +5254,7 @@
52625254
7BFC16A125249A9D00FF6266 /* SentryMessage.m in Sources */,
52635255
FA90FAFD2E070A3B008CAAE8 /* SentryURLRequestFactory.swift in Sources */,
52645256
7BCFBD6F2681D0EE00BC27D8 /* SentryCrashScopeObserver.m in Sources */,
5257+
FA90FAA82E06614E008CAAE8 /* SentryExtraPackages.swift in Sources */,
52655258
7BD86ED1264A7CF6005439DB /* SentryAppStartMeasurement.m in Sources */,
52665259
7DC27EC723997EB7006998B5 /* SentryAutoBreadcrumbTrackingIntegration.m in Sources */,
52675260
D84D2CDF2C2BF9370011AF8A /* SentryReplayType.swift in Sources */,
@@ -5345,7 +5338,6 @@
53455338
63AA769E1EB9C57A00D153DE /* SentryError.mm in Sources */,
53465339
7B8713B026415B22006D6004 /* SentryAppStartTrackingIntegration.m in Sources */,
53475340
8E133FA225E72DEF00ABD0BF /* SentrySamplingContext.m in Sources */,
5348-
33C374BB2D103F4D004598F1 /* SentryExtraPackages.m in Sources */,
53495341
D81988C02BEBFFF70020E36C /* SentryReplayRecording.swift in Sources */,
53505342
7B6C5F8726034395007F7DFF /* SentryWatchdogTerminationLogic.m in Sources */,
53515343
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)