Skip to content

Commit 18a5ec2

Browse files
committed
More
1 parent 211eae7 commit 18a5ec2

File tree

8 files changed

+24
-71
lines changed

8 files changed

+24
-71
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,8 +1104,6 @@
11041104
FA67DD192DDBD4EA00896B02 /* SwizzleClassNameExclude.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCD52DDBD4EA00896B02 /* SwizzleClassNameExclude.swift */; };
11051105
FA6FC0A32E0B5ACE00ED2669 /* SentrySdkPackage.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */; };
11061106
FA6FC0AA2E0B6B1100ED2669 /* SentrySdkInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6FC0A92E0B6B0E00ED2669 /* SentrySdkInfo.swift */; };
1107-
FA6FC0AC2E0B95EE00ED2669 /* SentrySwiftDictionaryHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FA6FC0AB2E0B95E400ED2669 /* SentrySwiftDictionaryHelper.h */; };
1108-
FA6FC0AE2E0B964700ED2669 /* SentrySwiftDictionaryHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FA6FC0AD2E0B963F00ED2669 /* SentrySwiftDictionaryHelper.m */; };
11091107
FA7206DF2E0B37850072FDD4 /* SentryProfileCollector.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7206DE2E0B37780072FDD4 /* SentryProfileCollector.h */; };
11101108
FA7206E12E0B37C80072FDD4 /* SentryProfileCollector.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */; };
11111109
FA8A36182DEAA1EB0058D883 /* SentryThread+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */; };
@@ -2454,8 +2452,6 @@
24542452
FA67DCF22DDBD4EA00896B02 /* SwiftDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDescriptor.swift; sourceTree = "<group>"; };
24552453
FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkPackage.swift; sourceTree = "<group>"; };
24562454
FA6FC0A92E0B6B0E00ED2669 /* SentrySdkInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkInfo.swift; sourceTree = "<group>"; };
2457-
FA6FC0AB2E0B95E400ED2669 /* SentrySwiftDictionaryHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentrySwiftDictionaryHelper.h; sourceTree = "<group>"; };
2458-
FA6FC0AD2E0B963F00ED2669 /* SentrySwiftDictionaryHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySwiftDictionaryHelper.m; sourceTree = "<group>"; };
24592455
FA7206DE2E0B37780072FDD4 /* SentryProfileCollector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryProfileCollector.h; sourceTree = "<group>"; };
24602456
FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfileCollector.mm; sourceTree = "<group>"; };
24612457
FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryThread+Private.h"; path = "include/SentryThread+Private.h"; sourceTree = "<group>"; };
@@ -2905,8 +2901,6 @@
29052901
639889D51EDF10BE00EA7442 /* Helper */ = {
29062902
isa = PBXGroup;
29072903
children = (
2908-
FA6FC0AB2E0B95E400ED2669 /* SentrySwiftDictionaryHelper.h */,
2909-
FA6FC0AD2E0B963F00ED2669 /* SentrySwiftDictionaryHelper.m */,
29102904
63AA76951EB9C1C200D153DE /* SentryDefines.h */,
29112905
627E7588299F6FE40085504D /* SentryInternalDefines.h */,
29122906
0A9E917028DC7E7000FB4182 /* SentryInternalCDefines.h */,
@@ -5106,7 +5100,6 @@
51065100
FAE80C242E4695B40010A595 /* SentryEvent+Serialize.h in Headers */,
51075101
7BD86ECF264A7C77005439DB /* SentryAppStartMeasurement.h in Headers */,
51085102
0354A22B2A134D9C003C3A04 /* SentryProfilerState.h in Headers */,
5109-
FA6FC0AC2E0B95EE00ED2669 /* SentrySwiftDictionaryHelper.h in Headers */,
51105103
7DC8310A2398283C0043DD9A /* SentryCrashIntegration.h in Headers */,
51115104
63FE718320DA4C1100CDBAE8 /* SentryCrashReportFixer.h in Headers */,
51125105
03F84D2027DD414C008FE43F /* SentryStackBounds.hpp in Headers */,
@@ -5882,7 +5875,6 @@
58825875
8454CF8D293EAF9A006AC140 /* SentryMetricProfiler.m in Sources */,
58835876
63FE714120DA4C1100CDBAE8 /* SentryCrashDate.c in Sources */,
58845877
D43B26DA2D70A612007747FD /* SentrySpanDataKey.m in Sources */,
5885-
FA6FC0AE2E0B964700ED2669 /* SentrySwiftDictionaryHelper.m in Sources */,
58865878
63FE70DB20DA4C1000CDBAE8 /* SentryCrashMonitor_System.m in Sources */,
58875879
7BA61CBB247BC5D800C130A8 /* SentryCrashDefaultBinaryImageProvider.m in Sources */,
58885880
63FE713120DA4C1100CDBAE8 /* SentryCrashDynamicLinker.c in Sources */,

Sources/Sentry/SentryHub.m

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

856856
#pragma mark - Protected
857857

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

Sources/Sentry/SentrySwiftDictionaryHelper.h

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

Sources/Sentry/SentrySwiftDictionaryHelper.m

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

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#import "SentryObjCRuntimeWrapper.h"
99
#import "SentryRandom.h"
1010
#import "SentrySDK+Private.h"
11-
#import "SentrySwiftDictionaryHelper.h"
1211
#import "SentryTime.h"
1312
#import "SentryUserAccess.h"
1413
#import "_SentryDispatchQueueWrapperInternal.h"

Sources/Swift/Core/Helper/SentryExtraPackages.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ import Foundation
1717
}
1818
}
1919

20-
@objc
21-
public static func getPackages() -> NSMutableSet {
20+
static func getPackages() -> Set<[String: String]> {
2221
lock.synchronized {
23-
NSMutableSet(set: extraPackages as NSSet)
22+
Set(extraPackages)
2423
}
2524
}
2625

Sources/Swift/Helper/SentrySdkInfo.swift

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import Foundation
88
*/
99
@_spi(Private) @objc public final class SentrySdkInfo: NSObject, SentrySerializable {
1010

11+
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
1112
@objc public static func global() -> Self {
12-
Self(withOptions: SentrySDK.currentHub().getClient()?.options)
13+
Self(withOptions: SentrySDKInternal.currentHub().getClient()?.options)
1314
}
1415

1516
/**
@@ -30,7 +31,7 @@ import Foundation
3031
* integrations are included because different SDK releases may contain different
3132
* default integrations.
3233
*/
33-
@objc let integrations: NSArray
34+
@objc let integrations: [String]
3435

3536
/**
3637
* A list of feature names identifying enabled SDK features. This list
@@ -45,30 +46,31 @@ import Foundation
4546
* activated integrations. Each package consists of a name in the format
4647
* source:identifier and version.
4748
*/
48-
@objc let packages: NSArray
49+
@objc let packages: [[String: String]]
4950

51+
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")
5052
@objc public convenience init(withOptions options: Options?) {
5153
let features = SentryEnabledFeaturesBuilder.getEnabledFeatures(options: options)
52-
let integrations = SentrySDK.currentHub().trimmedInstalledIntegrationNames()
53-
#if SENTRY_HAS_UIKIT
54+
let integrations = SentrySDKInternal.currentHub().trimmedInstalledIntegrationNames()
55+
#if (os(iOS) || os(tvOS) || os(visionOS)) && !SENTRY_NO_UIKIT
5456
if options.enablePreWarmedAppStartTracing {
5557
integrations.add("PreWarmedAppStartTracing")
5658
}
5759
#endif
58-
let packages = SentryExtraPackages.getPackages()
60+
var packages = SentryExtraPackages.getPackages()
5961
let sdkPackage = SentrySdkPackage.global()
6062
if let sdkPackage {
61-
packages.add(sdkPackage)
63+
packages.insert(sdkPackage)
6264
}
6365
self.init(
6466
name: SentryMeta.sdkName,
6567
version: SentryMeta.versionString,
6668
integrations: integrations,
6769
features: features,
68-
packages: packages.allObjects as NSArray)
70+
packages: Array(packages))
6971
}
7072

71-
@objc init(name: String?, version: String?, integrations: NSArray?, features: [String]?, packages: NSArray?) {
73+
@objc init(name: String?, version: String?, integrations: [String]?, features: [String]?, packages: [[String: String]]?) {
7274
self.name = name ?? ""
7375
self.version = version ?? ""
7476
self.integrations = integrations ?? []
@@ -122,21 +124,20 @@ import Foundation
122124
self.init(
123125
name: name,
124126
version: version,
125-
integrations: Array(integrations) as NSArray,
127+
integrations: Array(integrations),
126128
features: Array(features),
127-
packages: Array(packages) as NSArray
129+
packages: Array(packages)
128130
)
129131
}
130132
// swiftlint:enable cyclomatic_complexity
131133

132134
@objc public func serialize() -> [String: Any] {
133-
// let dictionary: [String: Any] = [
134-
// "name": self.name,
135-
// "version": self.version,
136-
// "integrations": self.integrations,
137-
// "features": self.features,
138-
// "packages": self.packages
139-
// ]
140-
return SentrySwiftDictionaryHelper.convert(from: self.name, version: self.version, integrations: self.integrations, features: self.features, packages: self.packages)
135+
let dictionary: [String: Any] = [
136+
"name": self.name,
137+
"version": self.version,
138+
"integrations": self.integrations,
139+
"features": self.features,
140+
"packages": self.packages
141+
]
141142
}
142143
}

0 commit comments

Comments
 (0)