Skip to content

Commit 7eafbde

Browse files
authored
ref: SentrySDKSettings to Swift (#5980)
1 parent 073562b commit 7eafbde

File tree

10 files changed

+38
-71
lines changed

10 files changed

+38
-71
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,6 @@
10321032
F41362112E1C55AF00B84443 /* SentryScopePersistentStore+Tags.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41362102E1C55AF00B84443 /* SentryScopePersistentStore+Tags.swift */; };
10331033
F41362132E1C566100B84443 /* SentryScopePersistentStore+User.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41362122E1C566100B84443 /* SentryScopePersistentStore+User.swift */; };
10341034
F41362152E1C568400B84443 /* SentryScopePersistentStore+Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41362142E1C568400B84443 /* SentryScopePersistentStore+Context.swift */; };
1035-
F429DCBB2E4A59370054383F /* SentrySDKSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = F429DCBA2E4A59370054383F /* SentrySDKSettings.m */; };
1036-
F429DCBC2E4A59370054383F /* SentrySDKSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = F429DCB92E4A59370054383F /* SentrySDKSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
10371035
F443DB272E09BE8C009A9045 /* LoadValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F443DB262E09BE8C009A9045 /* LoadValidatorTests.swift */; };
10381036
F44858132E03579D0013E63B /* SentryCrashDynamicLinker+Test.h in Headers */ = {isa = PBXBuildFile; fileRef = F44858122E0357940013E63B /* SentryCrashDynamicLinker+Test.h */; };
10391037
F451FAA62E0B304E0050ACF2 /* LoadValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F451FAA52E0B304E0050ACF2 /* LoadValidator.swift */; };
@@ -1125,6 +1123,7 @@
11251123
FAE80C242E4695B40010A595 /* SentryEvent+Serialize.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE80C232E4695AE0010A595 /* SentryEvent+Serialize.h */; };
11261124
FAEC270E2DF3526000878871 /* SentryUserFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */; };
11271125
FAEC273D2DF3933A00878871 /* NSData+Unzip.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEC273C2DF3933200878871 /* NSData+Unzip.m */; };
1126+
FAEFA12F2E4FAE1900C431D9 /* SentrySDKSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEFA1292E4FAE1700C431D9 /* SentrySDKSettings.swift */; };
11281127
/* End PBXBuildFile section */
11291128

11301129
/* Begin PBXContainerItemProxy section */
@@ -2380,8 +2379,6 @@
23802379
F41362102E1C55AF00B84443 /* SentryScopePersistentStore+Tags.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryScopePersistentStore+Tags.swift"; sourceTree = "<group>"; };
23812380
F41362122E1C566100B84443 /* SentryScopePersistentStore+User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryScopePersistentStore+User.swift"; sourceTree = "<group>"; };
23822381
F41362142E1C568400B84443 /* SentryScopePersistentStore+Context.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryScopePersistentStore+Context.swift"; sourceTree = "<group>"; };
2383-
F429DCB92E4A59370054383F /* SentrySDKSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySDKSettings.h; path = include/SentrySDKSettings.h; sourceTree = "<group>"; };
2384-
F429DCBA2E4A59370054383F /* SentrySDKSettings.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySDKSettings.m; sourceTree = "<group>"; };
23852382
F443DB262E09BE8C009A9045 /* LoadValidatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadValidatorTests.swift; sourceTree = "<group>"; };
23862383
F44858122E0357940013E63B /* SentryCrashDynamicLinker+Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryCrashDynamicLinker+Test.h"; sourceTree = "<group>"; };
23872384
F451FAA52E0B304E0050ACF2 /* LoadValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadValidator.swift; sourceTree = "<group>"; };
@@ -2475,6 +2472,7 @@
24752472
FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUserFeedback.swift; sourceTree = "<group>"; };
24762473
FAEC273C2DF3933200878871 /* NSData+Unzip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+Unzip.m"; sourceTree = "<group>"; };
24772474
FAEC273E2DF393E000878871 /* NSData+Unzip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+Unzip.h"; sourceTree = "<group>"; };
2475+
FAEFA1292E4FAE1700C431D9 /* SentrySDKSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySDKSettings.swift; sourceTree = "<group>"; };
24782476
/* End PBXFileReference section */
24792477

24802478
/* Begin PBXFrameworksBuildPhase section */
@@ -2742,8 +2740,6 @@
27422740
7BC9A20528F41781001E7C4C /* SentryMeasurementUnit.m */,
27432741
A8F17B2D2901765900990B25 /* SentryRequest.m */,
27442742
A8AFFCCE2906C03700967CD7 /* SentryRequest.h */,
2745-
F429DCB92E4A59370054383F /* SentrySDKSettings.h */,
2746-
F429DCBA2E4A59370054383F /* SentrySDKSettings.m */,
27472743
);
27482744
name = Protocol;
27492745
sourceTree = "<group>";
@@ -4706,6 +4702,7 @@
47064702
D8F016B12B9622B7007B9AFB /* Protocol */ = {
47074703
isa = PBXGroup;
47084704
children = (
4705+
FAEFA1292E4FAE1700C431D9 /* SentrySDKSettings.swift */,
47094706
620078752D38F1110022CB67 /* Codable */,
47104707
92ECD73B2E05ACDE0063EC10 /* SentryLog.swift */,
47114708
92ECD73F2E05AD500063EC10 /* SentryLogAttribute.swift */,
@@ -5125,7 +5122,6 @@
51255122
63BE85701ECEC6DE00DC44F5 /* SentryDateUtils.h in Headers */,
51265123
63FE709520DA4C1000CDBAE8 /* SentryCrashReportFilterBasic.h in Headers */,
51275124
844EDCE52947DC3100C86F34 /* SentryNSTimerFactory.h in Headers */,
5128-
F429DCBC2E4A59370054383F /* SentrySDKSettings.h in Headers */,
51295125
D8B088B629C9E3FF00213258 /* SentryTracerConfiguration.h in Headers */,
51305126
7B63459D280EBA6300CFA05A /* SentryUIEventTracker.h in Headers */,
51315127
7B7D873424864C6600D2ECFF /* SentryCrashDefaultMachineContextWrapper.h in Headers */,
@@ -5665,6 +5661,7 @@
56655661
F458D1172E186DF20028273E /* SentryScopePersistentStore+Fingerprint.swift in Sources */,
56665662
D8CB7417294724CC00A5F964 /* SentryEnvelopeAttachmentHeader.m in Sources */,
56675663
D84793262788737D00BE8E99 /* SentryByteCountFormatter.m in Sources */,
5664+
FAEFA12F2E4FAE1900C431D9 /* SentrySDKSettings.swift in Sources */,
56685665
63AA769E1EB9C57A00D153DE /* SentryError.mm in Sources */,
56695666
7B8713B026415B22006D6004 /* SentryAppStartTrackingIntegration.m in Sources */,
56705667
8E133FA225E72DEF00ABD0BF /* SentrySamplingContext.m in Sources */,
@@ -5885,7 +5882,6 @@
58855882
8E25C95325F836D000DC215B /* SentryRandom.m in Sources */,
58865883
03F84D3527DD4191008FE43F /* SentryThreadHandle.cpp in Sources */,
58875884
0A2D8DA9289BC905008720F6 /* SentryViewHierarchyProvider.m in Sources */,
5888-
F429DCBB2E4A59370054383F /* SentrySDKSettings.m in Sources */,
58895885
D84D2CDD2C2BF7370011AF8A /* SentryReplayEvent.swift in Sources */,
58905886
D8BC28CC2BFF78220054DA4D /* SentryRRWebTouchEvent.swift in Sources */,
58915887
D452FC592DDB4B1700AFF56F /* SentryWatchdogTerminationBreadcrumbProcessor.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 "SentrySDKSettings.h"
3130
header "SentryInternalSerializable.h"
3231

3332
export *

Sources/Sentry/SentrySDKSettings.m

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

Sources/Sentry/SentrySdkInfo.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#import "SentryMeta.h"
66
#import "SentryOptions.h"
77
#import "SentrySDK+Private.h"
8-
#import "SentrySDKSettings.h"
98
#import "SentrySwift.h"
109

1110
NS_ASSUME_NONNULL_BEGIN

Sources/Sentry/include/SentrySDKSettings.h

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Describes the settings for the Sentry SDK
3+
* @see https://develop.sentry.dev/sdk/event-payloads/sdk/
4+
*/
5+
@_spi(Private) @objc public final class SentrySDKSettings: NSObject {
6+
7+
@objc public override init() {
8+
autoInferIP = false
9+
}
10+
11+
@objc public init(options: Options?) {
12+
autoInferIP = options?.sendDefaultPii ?? false
13+
}
14+
15+
@objc public init(dict: NSDictionary) {
16+
if let inferIp = dict["infer_ip"] as? String {
17+
autoInferIP = inferIp == "auto"
18+
} else {
19+
autoInferIP = false
20+
}
21+
}
22+
23+
@objc public var autoInferIP: Bool
24+
25+
@objc public func serialize() -> NSDictionary {
26+
[
27+
"infer_ip": autoInferIP ? "auto" : "never"
28+
]
29+
}
30+
}

Tests/SentryTests/Networking/SentryNSURLRequestBuilderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testable import Sentry
1+
@_spi(Private) @testable import Sentry
22
import SentryTestUtils
33
import XCTest
44

Tests/SentryTests/Protocol/SentrySDKSettings+Equality.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import "SentrySDKSettings.h"
1+
#import <Sentry/Sentry-Swift.h>
22

33
NS_ASSUME_NONNULL_BEGIN
44

Tests/SentryTests/Protocol/SentrySdkInfo+Equality.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import "SentrySdkInfo+Equality.h"
2+
#import <Sentry/Sentry-Swift.h>
23

34
@implementation SentrySdkInfo (Equality)
45

Tests/SentryTests/Protocol/SentrySdkInfoNilTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#import "SentrySDKSettings.h"
21
#import "SentrySdkInfo.h"
2+
#import <Sentry/Sentry-Swift.h>
33
#import <XCTest/XCTest.h>
44

55
@interface SentrySdkInfoNilTests : XCTestCase

0 commit comments

Comments
 (0)