diff --git a/CHANGELOG.md b/CHANGELOG.md index f3559eac8a0..53b32665bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog -## Unreleased +## Unreleased + +This version introduces a dependency on Swift, which only impacts you if you don't use Swift. If your project uses Swift already, this change will not affect you. + +### Features + +- Properly demangle Swift class name (#2162) ### Fixes diff --git a/Package.swift b/Package.swift index 1fde2484238..4f552855c72 100644 --- a/Package.swift +++ b/Package.swift @@ -9,8 +9,15 @@ let package = Package( .library(name: "Sentry-Dynamic", type: .dynamic, targets: ["Sentry"]) ], targets: [ + .target( name: "SentryPrivate", + path: "Sources", + sources: [ + "Swift" + ] + ), .target( name: "Sentry", + dependencies: ["SentryPrivate"], path: "Sources", sources: [ "Sentry/", diff --git a/Samples/Carthage-Validation/Framework/input.xcfilelist b/Samples/Carthage-Validation/Framework/input.xcfilelist index 6c87cbf0d27..38c98e5185f 100644 --- a/Samples/Carthage-Validation/Framework/input.xcfilelist +++ b/Samples/Carthage-Validation/Framework/input.xcfilelist @@ -1 +1 @@ -$(SRCROOT)/Carthage/Build/iOS/Sentry.framework \ No newline at end of file +$(SRCROOT)/Carthage/Build/iOS/Sentry.framework diff --git a/Samples/Carthage-Validation/Framework/output.xcfilelist b/Samples/Carthage-Validation/Framework/output.xcfilelist index e2973ee20c3..d9ab7a67be9 100644 --- a/Samples/Carthage-Validation/Framework/output.xcfilelist +++ b/Samples/Carthage-Validation/Framework/output.xcfilelist @@ -1 +1 @@ -$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Sentry.framework \ No newline at end of file +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Sentry.framework diff --git a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj index 47b7303a508..2a27d031a17 100644 --- a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj +++ b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj @@ -132,6 +132,13 @@ remoteGlobalIDString = 637AFDA5243B02760034958B; remoteInfo = "iOS-Swift"; }; + D81A3499291D0B2C005A27A9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D81A3488291D0AC0005A27A9; + remoteInfo = SentryPrivate; + }; D83A30CA279F075800372D0A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; @@ -350,6 +357,7 @@ children = ( 630853322440C44F00DDE4CE /* Sentry.framework */, 630853342440C44F00DDE4CE /* SentryTests.xctest */, + D81A349A291D0B2C005A27A9 /* SentryPrivate.framework */, ); name = Products; sourceTree = ""; @@ -720,6 +728,13 @@ remoteRef = 630853332440C44F00DDE4CE /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + D81A349A291D0B2C005A27A9 /* SentryPrivate.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SentryPrivate.framework; + remoteRef = D81A3499291D0B2C005A27A9 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ diff --git a/Sentry.podspec b/Sentry.podspec index 746cc54d8c2..df479100bea 100644 --- a/Sentry.podspec +++ b/Sentry.podspec @@ -16,6 +16,7 @@ Pod::Spec.new do |s| s.requires_arc = true s.frameworks = 'Foundation' s.libraries = 'z', 'c++' + s.swift_versions = "5.5" s.pod_target_xcconfig = { 'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES', 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14', @@ -26,17 +27,18 @@ Pod::Spec.new do |s| } s.default_subspecs = ['Core'] + s.dependency "SentryPrivate" s.subspec 'Core' do |sp| sp.source_files = "Sources/Sentry/**/*.{h,hpp,m,mm,c,cpp}", - "Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}" - - sp.public_header_files = "Sources/Sentry/Public/*.h" + "Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/Swift/Sentry.swift" + sp.public_header_files = + "Sources/Sentry/Public/*.h" end s.subspec 'HybridSDK' do |sp| sp.source_files = "Sources/Sentry/**/*.{h,hpp,m,mm,c,cpp}", - "Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}" + "Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/Swift/Sentry.swift" sp.public_header_files = "Sources/Sentry/Public/*.h", "Sources/Sentry/include/PrivateSentrySDKOnly.h" diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index 4cec9a30249..ad1ab5c57a3 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -654,8 +654,6 @@ 8ED2D28026A6581C00CA8329 /* NSURLProtocolSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ED2D27F26A6581C00CA8329 /* NSURLProtocolSwizzle.m */; }; 8ED3D306264DFE700049393B /* SentryUIViewControllerSanitizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8ED3D305264DFE700049393B /* SentryUIViewControllerSanitizerTests.swift */; }; 8EE017A126704CD500470616 /* SentryUIViewControllerPerformanceTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EA1ED0E2669152F00E62B98 /* SentryUIViewControllerPerformanceTrackerTests.swift */; }; - 8EE32518261FE27B00DC3FF2 /* SentryUIViewControllerSanitizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8EE32516261FE27B00DC3FF2 /* SentryUIViewControllerSanitizer.m */; }; - 8EE3251C261FE33B00DC3FF2 /* SentryUIViewControllerSanitizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EE3251B261FE33B00DC3FF2 /* SentryUIViewControllerSanitizer.h */; }; A2475E1325FB63A3007D9080 /* fishhook.h in Headers */ = {isa = PBXBuildFile; fileRef = A2475E1225FB63A3007D9080 /* fishhook.h */; }; A2475E1725FB63AF007D9080 /* SentryHook.h in Headers */ = {isa = PBXBuildFile; fileRef = A2475E1625FB63AF007D9080 /* SentryHook.h */; }; A2475E1B25FB63D7007D9080 /* SentryHook.c in Sources */ = {isa = PBXBuildFile; fileRef = A2475E1A25FB63D7007D9080 /* SentryHook.c */; }; @@ -674,6 +672,11 @@ D808FB8B281BCE96009A2A33 /* TestSentrySwizzleWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D808FB89281BCE46009A2A33 /* TestSentrySwizzleWrapper.swift */; }; D808FB92281BF6EC009A2A33 /* SentryUIEventTrackingIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D808FB90281BF6E9009A2A33 /* SentryUIEventTrackingIntegrationTests.swift */; }; D8137D54272B53070082656C /* TestSentrySpan.m in Sources */ = {isa = PBXBuildFile; fileRef = D8137D53272B53070082656C /* TestSentrySpan.m */; }; + D81A346C291AECC7005A27A9 /* PrivateSentrySDKOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = D81A346B291AECC7005A27A9 /* PrivateSentrySDKOnly.h */; settings = {ATTRIBUTES = (Private, ); }; }; + D81A3491291D0AC8005A27A9 /* SwiftDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D800942628F82F3A005D3943 /* SwiftDescriptor.swift */; }; + D81A3492291D0AD5005A27A9 /* SentryPrivate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D81A3488291D0AC0005A27A9 /* SentryPrivate.framework */; }; + D81A3493291D0AD5005A27A9 /* SentryPrivate.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D81A3488291D0AC0005A27A9 /* SentryPrivate.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + D81A349E291D0D16005A27A9 /* Sentry.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A349B291D0C0B005A27A9 /* Sentry.swift */; }; D81FDF12280EA1060045E0E4 /* SentryScreenShotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81FDF10280EA0080045E0E4 /* SentryScreenShotTests.swift */; }; D8370B6A273DF1E900F66E2D /* SentryNSURLSessionTaskSearch.m in Sources */ = {isa = PBXBuildFile; fileRef = D8370B68273DF1E900F66E2D /* SentryNSURLSessionTaskSearch.m */; }; D8370B6C273DF20F00F66E2D /* SentryNSURLSessionTaskSearch.h in Headers */ = {isa = PBXBuildFile; fileRef = D8370B6B273DF20F00F66E2D /* SentryNSURLSessionTaskSearch.h */; }; @@ -705,7 +708,6 @@ D88817DA26D72AB800BF2251 /* SentryTraceContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D88817D926D72AB800BF2251 /* SentryTraceContext.h */; }; D88817DD26D72BA500BF2251 /* SentryTraceStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D88817DB26D72B7B00BF2251 /* SentryTraceStateTests.swift */; }; D8918B222849FA6D00701F9A /* SentrySDKIntegrationTestsBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8918B212849FA6D00701F9A /* SentrySDKIntegrationTestsBase.swift */; }; - D8A22A6929140081006907D9 /* PrivateSentrySDKOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = D8A22A6829140081006907D9 /* PrivateSentrySDKOnly.h */; settings = {ATTRIBUTES = (Private, ); }; }; D8AB40DB2806EC1900E5E9F7 /* SentryScreenshotIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = D8AB40DA2806EC1900E5E9F7 /* SentryScreenshotIntegration.h */; }; D8ACE3C72762187200F5A213 /* SentryNSDataSwizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = D8ACE3C42762187200F5A213 /* SentryNSDataSwizzling.m */; }; D8ACE3C82762187200F5A213 /* SentryNSDataTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = D8ACE3C52762187200F5A213 /* SentryNSDataTracker.m */; }; @@ -715,6 +717,7 @@ D8ACE3CF2762187D00F5A213 /* SentryFileIOTrackingIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = D8ACE3CC2762187D00F5A213 /* SentryFileIOTrackingIntegration.h */; }; D8B76B062808066D000A58C4 /* SentryScreenshotIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8B76B042808060E000A58C4 /* SentryScreenshotIntegrationTests.swift */; }; D8B76B0828081461000A58C4 /* TestSentryScreenShot.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8B76B0728081461000A58C4 /* TestSentryScreenShot.swift */; }; + D8BBD32728FD9FC00011F850 /* SentrySwift.h in Headers */ = {isa = PBXBuildFile; fileRef = D8BBD32628FD9FBF0011F850 /* SentrySwift.h */; }; D8C67E9B28000E24007E326E /* SentryUIApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C67E9928000E23007E326E /* SentryUIApplication.h */; }; D8C67E9C28000E24007E326E /* SentryScreenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C67E9A28000E23007E326E /* SentryScreenshot.h */; }; D8CE69BC277E39C700C6EC5C /* SentryFileIOTrackingIntegrationObjCTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D8CE69BB277E39C700C6EC5C /* SentryFileIOTrackingIntegrationObjCTests.m */; }; @@ -732,8 +735,29 @@ remoteGlobalIDString = 63AA759A1EB8AEF500D153DE; remoteInfo = "Sentry-iOS"; }; + D81A3494291D0AD5005A27A9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6327C5CA1EB8A783004E799B /* Project object */; + proxyType = 1; + remoteGlobalIDString = D81A3487291D0AC0005A27A9; + remoteInfo = SentryPrivate; + }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + D81A3496291D0AD5005A27A9 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + D81A3493291D0AD5005A27A9 /* SentryPrivate.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 0356A56E288B4612008BF593 /* SentryProfilesSampler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryProfilesSampler.h; path = Sources/Sentry/SentryProfilesSampler.h; sourceTree = SOURCE_ROOT; }; 0356A56F288B4612008BF593 /* SentryProfilesSampler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SentryProfilesSampler.m; path = Sources/Sentry/SentryProfilesSampler.m; sourceTree = SOURCE_ROOT; }; @@ -1446,8 +1470,6 @@ 8ED2D27E26A6581C00CA8329 /* NSURLProtocolSwizzle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSURLProtocolSwizzle.h; sourceTree = ""; }; 8ED2D27F26A6581C00CA8329 /* NSURLProtocolSwizzle.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NSURLProtocolSwizzle.m; sourceTree = ""; }; 8ED3D305264DFE700049393B /* SentryUIViewControllerSanitizerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUIViewControllerSanitizerTests.swift; sourceTree = ""; }; - 8EE32516261FE27B00DC3FF2 /* SentryUIViewControllerSanitizer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryUIViewControllerSanitizer.m; sourceTree = ""; }; - 8EE3251B261FE33B00DC3FF2 /* SentryUIViewControllerSanitizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryUIViewControllerSanitizer.h; path = include/SentryUIViewControllerSanitizer.h; sourceTree = ""; }; A2475E1225FB63A3007D9080 /* fishhook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fishhook.h; sourceTree = ""; }; A2475E1625FB63AF007D9080 /* SentryHook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SentryHook.h; sourceTree = ""; }; A2475E1A25FB63D7007D9080 /* SentryHook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SentryHook.c; sourceTree = ""; }; @@ -1461,12 +1483,18 @@ A8AFFCD32907E0CA00967CD7 /* SentryRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryRequestTests.swift; sourceTree = ""; }; A8F17B2D2901765900990B25 /* SentryRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryRequest.m; sourceTree = ""; }; A8F17B332902870300990B25 /* SentryHttpStatusCodeRange.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryHttpStatusCodeRange.m; sourceTree = ""; }; + D800942628F82F3A005D3943 /* SwiftDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDescriptor.swift; sourceTree = ""; }; D801990F286B089000C277F0 /* SentryCrashReportSinkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashReportSinkTests.swift; sourceTree = ""; }; D808FB86281AB31D009A2A33 /* SentryUIEventTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUIEventTrackerTests.swift; sourceTree = ""; }; D808FB89281BCE46009A2A33 /* TestSentrySwizzleWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentrySwizzleWrapper.swift; sourceTree = ""; }; D808FB90281BF6E9009A2A33 /* SentryUIEventTrackingIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUIEventTrackingIntegrationTests.swift; sourceTree = ""; }; D8137D52272B53070082656C /* TestSentrySpan.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestSentrySpan.h; sourceTree = ""; }; D8137D53272B53070082656C /* TestSentrySpan.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestSentrySpan.m; sourceTree = ""; }; + D81A346B291AECC7005A27A9 /* PrivateSentrySDKOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrivateSentrySDKOnly.h; path = include/PrivateSentrySDKOnly.h; sourceTree = ""; }; + D81A3488291D0AC0005A27A9 /* SentryPrivate.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SentryPrivate.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D81A349B291D0C0B005A27A9 /* Sentry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sentry.swift; sourceTree = ""; }; + D81A349F291D5568005A27A9 /* SentryPrivate.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = SentryPrivate.podspec; sourceTree = ""; }; + D81A34A0291D5715005A27A9 /* SentryPrivate.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SentryPrivate.xcconfig; sourceTree = ""; }; D81FDF10280EA0080045E0E4 /* SentryScreenShotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScreenShotTests.swift; sourceTree = ""; }; D8370B68273DF1E900F66E2D /* SentryNSURLSessionTaskSearch.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryNSURLSessionTaskSearch.m; sourceTree = ""; }; D8370B6B273DF20F00F66E2D /* SentryNSURLSessionTaskSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryNSURLSessionTaskSearch.h; path = include/SentryNSURLSessionTaskSearch.h; sourceTree = ""; }; @@ -1508,6 +1536,7 @@ D8ACE3CC2762187D00F5A213 /* SentryFileIOTrackingIntegration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryFileIOTrackingIntegration.h; path = include/SentryFileIOTrackingIntegration.h; sourceTree = ""; }; D8B76B042808060E000A58C4 /* SentryScreenshotIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScreenshotIntegrationTests.swift; sourceTree = ""; }; D8B76B0728081461000A58C4 /* TestSentryScreenShot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryScreenShot.swift; sourceTree = ""; }; + D8BBD32628FD9FBF0011F850 /* SentrySwift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySwift.h; path = include/SentrySwift.h; sourceTree = ""; }; D8C67E9928000E23007E326E /* SentryUIApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryUIApplication.h; path = include/SentryUIApplication.h; sourceTree = ""; }; D8C67E9A28000E23007E326E /* SentryScreenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryScreenshot.h; path = include/SentryScreenshot.h; sourceTree = ""; }; D8CE69BB277E39C700C6EC5C /* SentryFileIOTrackingIntegrationObjCTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryFileIOTrackingIntegrationObjCTests.m; sourceTree = ""; }; @@ -1523,6 +1552,7 @@ buildActionMask = 2147483647; files = ( 63AF656C1ED87B8C00EBCFF7 /* libz.tbd in Frameworks */, + D81A3492291D0AD5005A27A9 /* SentryPrivate.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1534,6 +1564,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D81A3485291D0AC0005A27A9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -1719,6 +1756,7 @@ 844DA80E28246D5000E6B62E /* LICENSE.md */, 844DA80F28246D5000E6B62E /* README.md */, 844DA80528246D5000E6B62E /* Sentry.podspec */, + D81A349F291D5568005A27A9 /* SentryPrivate.podspec */, 844DA80D28246D5000E6B62E /* Package.swift */, 844DA80628246D5000E6B62E /* .craft.yml */, 844DA80A28246D5000E6B62E /* .swiftlint.yml */, @@ -1727,6 +1765,7 @@ 63AA756E1EB8AEDB00D153DE /* Sources */, 63AA75921EB8AEDB00D153DE /* Tests */, 7D826E3C2390840E00EED93D /* Utils */, + D81A346A291AEC23005A27A9 /* Recovered References */, ); indentWidth = 4; sourceTree = ""; @@ -1737,6 +1776,7 @@ children = ( 63AA759B1EB8AEF500D153DE /* Sentry.framework */, 63AA76651EB8CB2F00D153DE /* SentryTests.xctest */, + D81A3488291D0AC0005A27A9 /* SentryPrivate.framework */, ); name = Products; sourceTree = ""; @@ -1875,6 +1915,7 @@ 63AA756E1EB8AEDB00D153DE /* Sources */ = { isa = PBXGroup; children = ( + D800942328F82E8D005D3943 /* Swift */, 63AA75A31EB8AFDF00D153DE /* Configuration */, 63FE6FB920DA4C1000CDBAE8 /* SentryCrash */, 63AA75C61EB8B06100D153DE /* Sentry */, @@ -1950,6 +1991,7 @@ isa = PBXGroup; children = ( 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */, + D81A34A0291D5715005A27A9 /* SentryPrivate.xcconfig */, ); path = Configuration; sourceTree = ""; @@ -1969,7 +2011,8 @@ 8ECC673625C23936000E2BF6 /* Transaction */, 8E25C94F25F836AB00DC215B /* Tools */, 63AA76931EB9C1C200D153DE /* Sentry.h */, - D8A22A6829140081006907D9 /* PrivateSentrySDKOnly.h */, + D8BBD32628FD9FBF0011F850 /* SentrySwift.h */, + D81A346B291AECC7005A27A9 /* PrivateSentrySDKOnly.h */, 7B6D1260265F784000C9BE4B /* PrivateSentrySDKOnly.m */, 63AA76941EB9C1C200D153DE /* SentryClient.h */, 63AA75ED1EB8B3C400D153DE /* SentryClient.m */, @@ -2773,8 +2816,6 @@ 8E25C94F25F836AB00DC215B /* Tools */ = { isa = PBXGroup; children = ( - 8EE3251B261FE33B00DC3FF2 /* SentryUIViewControllerSanitizer.h */, - 8EE32516261FE27B00DC3FF2 /* SentryUIViewControllerSanitizer.m */, 8E25C95625F836EE00DC215B /* SentryRandom.h */, 8E25C95125F836D000DC215B /* SentryRandom.m */, D8C67E9A28000E23007E326E /* SentryScreenshot.h */, @@ -2840,6 +2881,15 @@ name = Transaction; sourceTree = ""; }; + D800942328F82E8D005D3943 /* Swift */ = { + isa = PBXGroup; + children = ( + D81A349B291D0C0B005A27A9 /* Sentry.swift */, + D800942628F82F3A005D3943 /* SwiftDescriptor.swift */, + ); + path = Swift; + sourceTree = ""; + }; D808FB85281AB2EF009A2A33 /* UIEvents */ = { isa = PBXGroup; children = ( @@ -2849,6 +2899,14 @@ path = UIEvents; sourceTree = ""; }; + D81A346A291AEC23005A27A9 /* Recovered References */ = { + isa = PBXGroup; + children = ( + D8A22A6829140081006907D9 /* PrivateSentrySDKOnly.h */, + ); + name = "Recovered References"; + sourceTree = ""; + }; D81FDF0F280E9FEC0045E0E4 /* Tools */ = { isa = PBXGroup; children = ( @@ -2936,6 +2994,7 @@ 0ADC33EE28D9BB890078D980 /* SentryUIDeviceWrapper.h in Headers */, 8E133FA625E72EB400ABD0BF /* SentrySamplingContext.h in Headers */, 0A9BF4E428A114B50068D266 /* SentryViewHierarchyIntegration.h in Headers */, + D8BBD32728FD9FC00011F850 /* SentrySwift.h in Headers */, 8E4E7C7425DAAB49006AB9E2 /* SentrySpanProtocol.h in Headers */, 8EC4CF4A25C38DAA0093DEE9 /* SentrySpanStatus.h in Headers */, 8ECC673D25C23996000E2BF6 /* SentrySpanId.h in Headers */, @@ -2951,6 +3010,7 @@ 7B4E23BE251A2BD500060D68 /* SentrySessionCrashedHandler.h in Headers */, 7B88F2FE24BC5A4C00ADF90A /* SentrySdkInfo.h in Headers */, 7BCFBD672681C95000BC27D8 /* SentryScopeObserver.h in Headers */, + D81A346C291AECC7005A27A9 /* PrivateSentrySDKOnly.h in Headers */, D88817DA26D72AB800BF2251 /* SentryTraceContext.h in Headers */, 7B6C5F8126034354007F7DFF /* SentryOutOfMemoryLogic.h in Headers */, 63FE708520DA4C1000CDBAE8 /* SentryCrashReportFilter.h in Headers */, @@ -2992,7 +3052,6 @@ 63FE70D120DA4C1000CDBAE8 /* SentryCrashMonitorContext.h in Headers */, 63B818F91EC34639002FDF4C /* SentryDebugMeta.h in Headers */, 6360850D1ED2AFE100E8599E /* SentryBreadcrumb.h in Headers */, - 8EE3251C261FE33B00DC3FF2 /* SentryUIViewControllerSanitizer.h in Headers */, 7BAF3DD92440AEC8008A5414 /* SentryRequestManager.h in Headers */, 7BE3C77B2446111500A38442 /* SentryRateLimitParser.h in Headers */, 84A888FD28D9B11700C51DFD /* SentryProfiler+Test.h in Headers */, @@ -3004,7 +3063,6 @@ 63FE717920DA4C1100CDBAE8 /* SentryCrashReportStore.h in Headers */, 0AAE202128ED9BCC00D0CD80 /* SentryReachability.h in Headers */, A839D89824864B80003B7AFD /* SentrySystemEventBreadcrumbs.h in Headers */, - D8A22A6929140081006907D9 /* PrivateSentrySDKOnly.h in Headers */, 7B14089624878F090035403D /* SentryCrashStackEntryMapper.h in Headers */, 63FE714920DA4C1100CDBAE8 /* SentryCrashStackCursor_Backtrace.h in Headers */, 7BFC169B2524995700FF6266 /* SentryMessage.h in Headers */, @@ -3200,6 +3258,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D81A3483291D0AC0005A27A9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -3207,14 +3272,16 @@ isa = PBXNativeTarget; buildConfigurationList = 63AA75A01EB8AEF500D153DE /* Build configuration list for PBXNativeTarget "Sentry" */; buildPhases = ( + 63AA75981EB8AEF500D153DE /* Headers */, 63AA75961EB8AEF500D153DE /* Sources */, 63AA75971EB8AEF500D153DE /* Frameworks */, - 63AA75981EB8AEF500D153DE /* Headers */, 63AA75991EB8AEF500D153DE /* Resources */, + D81A3496291D0AD5005A27A9 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( + D81A3495291D0AD5005A27A9 /* PBXTargetDependency */, ); name = Sentry; productName = "Sentry-iOS"; @@ -3239,19 +3306,37 @@ productReference = 63AA76651EB8CB2F00D153DE /* SentryTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + D81A3487291D0AC0005A27A9 /* SentryPrivate */ = { + isa = PBXNativeTarget; + buildConfigurationList = D81A348C291D0AC0005A27A9 /* Build configuration list for PBXNativeTarget "SentryPrivate" */; + buildPhases = ( + D81A3483291D0AC0005A27A9 /* Headers */, + D81A3484291D0AC0005A27A9 /* Sources */, + D81A3485291D0AC0005A27A9 /* Frameworks */, + D81A3486291D0AC0005A27A9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SentryPrivate; + productName = SentryPrivate; + productReference = D81A3488291D0AC0005A27A9 /* SentryPrivate.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 6327C5CA1EB8A783004E799B /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1250; + LastSwiftUpdateCheck = 1410; LastUpgradeCheck = 1400; ORGANIZATIONNAME = Sentry; TargetAttributes = { 63AA759A1EB8AEF500D153DE = { CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = 1400; + LastSwiftMigration = 1410; ProvisioningStyle = Manual; }; 63AA76641EB8CB2F00D153DE = { @@ -3259,6 +3344,10 @@ LastSwiftMigration = 1120; ProvisioningStyle = Manual; }; + D81A3487291D0AC0005A27A9 = { + CreatedOnToolsVersion = 14.1; + ProvisioningStyle = Manual; + }; }; }; buildConfigurationList = 6327C5CD1EB8A783004E799B /* Build configuration list for PBXProject "Sentry" */; @@ -3276,6 +3365,7 @@ targets = ( 63AA759A1EB8AEF500D153DE /* Sentry */, 63AA76641EB8CB2F00D153DE /* SentryTests */, + D81A3487291D0AC0005A27A9 /* SentryPrivate */, ); }; /* End PBXProject section */ @@ -3296,6 +3386,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D81A3486291D0AC0005A27A9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -3374,6 +3471,7 @@ 630435FF1EBCA9D900C4D3FA /* SentryNSURLRequest.m in Sources */, 7B5CAF7727F5A68C00ED0DB6 /* SentryNSURLRequestBuilder.m in Sources */, 639FCFA11EBC804600778193 /* SentryException.m in Sources */, + D81A349E291D0D16005A27A9 /* Sentry.swift in Sources */, 7BA61CAD247BAA0B00C130A8 /* SentryDebugImageProvider.m in Sources */, 63FE70E720DA4C1000CDBAE8 /* SentryCrashMonitor.c in Sources */, D85852B627ECEEDA00C6D8AE /* SentryScreenshot.m in Sources */, @@ -3423,7 +3521,6 @@ 63AA767A1EB8D20500D153DE /* SentryLog.m in Sources */, 6344DDBA1EC3115C00D9160D /* SentryCrashReportConverter.m in Sources */, 63FE70FD20DA4C1000CDBAE8 /* SentryCrashCachedData.c in Sources */, - 8EE32518261FE27B00DC3FF2 /* SentryUIViewControllerSanitizer.m in Sources */, A8F17B2E2901765900990B25 /* SentryRequest.m in Sources */, 7BE1E33424F7E3CB009D3AD0 /* SentryMigrateSessionInit.m in Sources */, 15E0A8F22411A45A00F044E3 /* SentrySession.m in Sources */, @@ -3760,6 +3857,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D81A3484291D0AC0005A27A9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D81A3491291D0AC8005A27A9 /* SwiftDescriptor.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -3768,6 +3873,11 @@ target = 63AA759A1EB8AEF500D153DE /* Sentry */; targetProxy = 63AA766B1EB8CB2F00D153DE /* PBXContainerItemProxy */; }; + D81A3495291D0AD5005A27A9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D81A3487291D0AC0005A27A9 /* SentryPrivate */; + targetProxy = D81A3494291D0AD5005A27A9 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -3924,6 +4034,7 @@ GCC_WARN_SHADOW = YES; INFOPLIST_FILE = Sources/Sentry/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; @@ -3978,6 +4089,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ENABLE_MODULES = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -4006,6 +4118,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ENABLE_MODULES = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -4128,6 +4241,7 @@ GCC_WARN_SHADOW = YES; INFOPLIST_FILE = Sources/Sentry/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; @@ -4145,6 +4259,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ENABLE_MODULES = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -4261,6 +4376,7 @@ GCC_WARN_SHADOW = YES; INFOPLIST_FILE = Sources/Sentry/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; @@ -4278,6 +4394,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ENABLE_MODULES = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -4302,6 +4419,129 @@ }; name = Test; }; + D81A348D291D0AC0005A27A9 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D81A34A0291D5715005A27A9 /* SentryPrivate.xcconfig */; + buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Manual; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 Sentry. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.sentry.SentryPrivate; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + D81A348E291D0AC0005A27A9 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D81A34A0291D5715005A27A9 /* SentryPrivate.xcconfig */; + buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Manual; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 Sentry. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.sentry.SentryPrivate; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Test; + }; + D81A348F291D0AC0005A27A9 /* TestCI */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D81A34A0291D5715005A27A9 /* SentryPrivate.xcconfig */; + buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Manual; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 Sentry. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.sentry.SentryPrivate; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = TestCI; + }; + D81A3490291D0AC0005A27A9 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D81A34A0291D5715005A27A9 /* SentryPrivate.xcconfig */; + buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Manual; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 Sentry. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.sentry.SentryPrivate; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -4338,6 +4578,17 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D81A348C291D0AC0005A27A9 /* Build configuration list for PBXNativeTarget "SentryPrivate" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D81A348D291D0AC0005A27A9 /* Debug */, + D81A348E291D0AC0005A27A9 /* Test */, + D81A348F291D0AC0005A27A9 /* TestCI */, + D81A3490291D0AC0005A27A9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 6327C5CA1EB8A783004E799B /* Project object */; diff --git a/Sentry.xcodeproj/xcshareddata/xcschemes/SentryPrivate.xcscheme b/Sentry.xcodeproj/xcshareddata/xcschemes/SentryPrivate.xcscheme new file mode 100644 index 00000000000..58096bd9b9c --- /dev/null +++ b/Sentry.xcodeproj/xcshareddata/xcschemes/SentryPrivate.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SentryPrivate.podspec b/SentryPrivate.podspec new file mode 100644 index 00000000000..798be81b765 --- /dev/null +++ b/SentryPrivate.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |s| + s.name = "SentryPrivate" + s.version = "7.30.0" + s.summary = "Sentry Private Library." + s.homepage = "https://github.com/getsentry/sentry-cocoa" + s.license = "mit" + s.authors = "Sentry" + s.source = { :git => "https://github.com/getsentry/sentry-cocoa.git", + :tag => s.version.to_s } + s.social_media_url = 'https://getsentry.com/' + + s.description = <<-DESC + Not for public use. + Common APIs for internal Sentry usage. + DESC + + s.ios.deployment_target = "9.0" + s.osx.deployment_target = "10.10" + s.tvos.deployment_target = "9.0" + s.watchos.deployment_target = "2.0" + s.module_name = "SentryPrivate" + s.frameworks = 'Foundation' + + s.swift_versions = "5.5" + s.watchos.framework = 'WatchKit' + + s.source_files = "Sources/Swift/**/*.{swift}" +end diff --git a/Sources/Configuration/SentryPrivate.xcconfig b/Sources/Configuration/SentryPrivate.xcconfig new file mode 100644 index 00000000000..58b6f292210 --- /dev/null +++ b/Sources/Configuration/SentryPrivate.xcconfig @@ -0,0 +1,65 @@ +SDKROOT = $(SDKROOT__CARTHAGE_$(CARTHAGE)) // basically, iphoneos (unless «CARTHAGE» == «YES») +// Carthage relies on this assumption, years standing — that SDKROOT is default or explicitly +// set to `macosx` (or equivalent) under the ‘single target, multiple platform’ paradigm +// because of a xcodebuild bug involving the sdk flag and implicit dependency: see «Carthage/Carthage#347». +SDKROOT__CARTHAGE_YES = macosx +// Importantly, the below two lines appease «Xcode.app», and get the UI to show Mac Catalyst destinations. +SDKROOT__CARTHAGE_NO = iphoneos +SDKROOT__CARTHAGE_ = iphoneos +// …in order for ‘single target, multiple platform’ extrapolations to hold true, +// all the above relies on the ability of Xcode GUI, xcodebuild, and Carthage via xcodebuild to +// override «SDKROOT» based on selected destination (particularly for appletv* and watchos* platforms.) +// …if the override behavior ever breaks, expect weird output and the probable need to migrate away from +// the ‘single target, multiple platform’ paradigm. + +// …`SUPPORTED_PLATFORMS`, in service of ‘single target, multiple platform’ extrapolation, must never +// engage in dollar-parentheses syntax — unless that dollar-parentheses basis is +// entirely non-platform–derived, e.g. based upon `XCODE_VERSION_MAJOR`. +// Note: Carthage, unfortunately, as current of v0.34.0 queries rather harshly on the platform values below +// ⋯ quite early in the process, queried values not compiled into Carthage will cause hard errors. +SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator +TARGETED_DEVICE_FAMILY = 1,2,3,4 +SKIP_INSTALL = YES +DEFINES_MODULE = YES +DYLIB_COMPATIBILITY_VERSION = 1 +DYLIB_CURRENT_VERSION = 1 +DYLIB_INSTALL_NAME_BASE = @rpath +MACH_O_TYPE = mh_dylib +FRAMEWORK_VERSION = A + +PRODUCT_NAME = SentryPrivate +CURRENT_PROJECT_VERSION = 7.30.0 +PRODUCT_BUNDLE_IDENTIFIER = io.sentry.SentryPrivate +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_ENABLE_OBJC_ARC = YES +CLANG_ENABLE_MODULES = YES +//OTHER_CFLAGS = -Wall -Wextra -Wpedantic -Wno-gnu-conditional-omitted-operand + +ONLY_ACTIVE_ARCH[config=Debug] = YES +GCC_OPTIMIZATION_LEVEL[config=Debug] = 0 +COPY_PHASE_STRIP[config=Debug] = NO + +MACOSX_DEPLOYMENT_TARGET = 10.9 +IPHONEOS_DEPLOYMENT_TARGET = 9.0 +WATCHOS_DEPLOYMENT_TARGET = 2.0 +TVOS_DEPLOYMENT_TARGET = 9.0 + +LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks; +LD_RUNPATH_SEARCH_PATHS[sdk=iphone*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks; +LD_RUNPATH_SEARCH_PATHS[sdk=watch*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks; +LD_RUNPATH_SEARCH_PATHS[sdk=appletv*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks; + +OTHER_LDFLAGS[sdk=watch*] = $(inherited) -framework WatchKit + +//SWIFT_INCLUDE_PATHS = $(SRCROOT)/Sources/Sentry + +// SWIFT_VERSION is only recognized by Xcode 8 and higher. +// Prior versions of Xcode support only one Swift version. +// SWIFT_VERSION = 3.1 + +// Although `YES` is the default for iOS targets, command-line output via `xcodebuild -showBuildSettings` +// will not emit this value unless it is explicitly set. +SUPPORTS_MACCATALYST = YES + +CLANG_CXX_LANGUAGE_STANDARD = c++14 +CLANG_CXX_LIBRARY = libc++ diff --git a/Sources/Sentry/Public/SentryStacktrace.h b/Sources/Sentry/Public/SentryStacktrace.h index 663b22505d8..6fd90bd8b17 100644 --- a/Sources/Sentry/Public/SentryStacktrace.h +++ b/Sources/Sentry/Public/SentryStacktrace.h @@ -7,7 +7,6 @@ NS_ASSUME_NONNULL_BEGIN @class SentryFrame; -NS_SWIFT_NAME(Stacktrace) @interface SentryStacktrace : NSObject SENTRY_NO_INIT diff --git a/Sources/Sentry/Public/SentryThread.h b/Sources/Sentry/Public/SentryThread.h index 7546e419ea0..ecca3e03e06 100644 --- a/Sources/Sentry/Public/SentryThread.h +++ b/Sources/Sentry/Public/SentryThread.h @@ -5,7 +5,6 @@ NS_ASSUME_NONNULL_BEGIN @class SentryStacktrace; -NS_SWIFT_NAME(Thread) @interface SentryThread : NSObject SENTRY_NO_INIT diff --git a/Sources/Sentry/SentryBreadcrumbTracker.m b/Sources/Sentry/SentryBreadcrumbTracker.m index 6022b4d18bb..ecd8b1ef7e2 100644 --- a/Sources/Sentry/SentryBreadcrumbTracker.m +++ b/Sources/Sentry/SentryBreadcrumbTracker.m @@ -6,9 +6,9 @@ #import "SentryLog.h" #import "SentrySDK+Private.h" #import "SentryScope.h" +#import "SentrySwift.h" #import "SentrySwizzle.h" #import "SentrySwizzleWrapper.h" -#import "SentryUIViewControllerSanitizer.h" #if SENTRY_HAS_UIKIT # import @@ -234,8 +234,7 @@ + (NSDictionary *)fetchInfoAboutViewController:(UIViewController *)controller { NSMutableDictionary *info = @{}.mutableCopy; - info[@"screen"] = [SentryUIViewControllerSanitizer - sanitizeViewControllerName:[NSString stringWithFormat:@"%@", controller]]; + info[@"screen"] = [SwiftDescriptor getObjectClassName:controller]; if ([controller.navigationItem.title length] != 0) { info[@"title"] = controller.navigationItem.title; @@ -246,13 +245,13 @@ + (NSDictionary *)fetchInfoAboutViewController:(UIViewController *)controller info[@"beingPresented"] = controller.beingPresented ? @"true" : @"false"; if (controller.presentingViewController != nil) { - info[@"presentingViewController"] = [SentryUIViewControllerSanitizer - sanitizeViewControllerName:controller.presentingViewController]; + info[@"presentingViewController"] = + [SwiftDescriptor getObjectClassName:controller.presentingViewController]; } if (controller.parentViewController != nil) { - info[@"parentViewController"] = [SentryUIViewControllerSanitizer - sanitizeViewControllerName:controller.parentViewController]; + info[@"parentViewController"] = + [SwiftDescriptor getObjectClassName:controller.parentViewController]; } if (controller.view.window != nil) { diff --git a/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m b/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m index c5ee506b561..c5743565c8e 100644 --- a/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m +++ b/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m @@ -6,7 +6,7 @@ #import "SentrySDK+Private.h" #import "SentryScope.h" #import "SentrySpanId.h" -#import "SentryUIViewControllerSanitizer.h" +#import "SentrySwift.h" #import #import #import @@ -89,7 +89,7 @@ - (void)createTransaction:(UIViewController *)controller // If the user manually calls loadView outside the lifecycle we don't start a new transaction // and override the previous id stored. if (spanId == nil) { - NSString *name = [SentryUIViewControllerSanitizer sanitizeViewControllerName:controller]; + NSString *name = [SwiftDescriptor getObjectClassName:controller]; spanId = [self.tracker startSpanWithName:name nameSource:kSentryTransactionNameSourceComponent operation:SentrySpanOperationUILoad]; diff --git a/Sources/Sentry/SentryUIViewControllerSanitizer.m b/Sources/Sentry/SentryUIViewControllerSanitizer.m deleted file mode 100644 index bbf608e93be..00000000000 --- a/Sources/Sentry/SentryUIViewControllerSanitizer.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SentryUIViewControllerSanitizer.h" - -@implementation SentryUIViewControllerSanitizer - -+ (NSRegularExpression *)viewControllerRegex -{ - static dispatch_once_t onceTokenRegex; - static NSRegularExpression *regex = nil; - dispatch_once(&onceTokenRegex, ^{ - NSString *pattern = @"[<.](\\w+)"; - regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil]; - }); - return regex; -} - -+ (NSString *)sanitizeViewControllerName:(id)controller -{ - NSString *description = [NSString stringWithFormat:@"%@", controller]; - - NSRange searchedRange = NSMakeRange(0, [description length]); - NSArray *matches = [[self.class viewControllerRegex] matchesInString:description - options:0 - range:searchedRange]; - NSMutableArray *strings = [NSMutableArray array]; - for (NSTextCheckingResult *match in matches) { - [strings addObject:[description substringWithRange:[match rangeAtIndex:1]]]; - } - if ([strings count] > 0) { - return [strings componentsJoinedByString:@"."]; - } - return description; -} - -@end diff --git a/Sources/Sentry/include/SentrySwift.h b/Sources/Sentry/include/SentrySwift.h new file mode 100644 index 00000000000..55ab04ecc71 --- /dev/null +++ b/Sources/Sentry/include/SentrySwift.h @@ -0,0 +1,20 @@ +#ifndef SentrySwift_h +#define SentrySwift_h + +/* + * This is a header to expose Swift code to Objective-C. + * + * Because we use three different package managers + * we need to target the Swift module in different ways. + * + * If the project is being used through SPM, Swift and Objective-C are compiled into separated + * targets, then we use "@import SentrySwift". + * + * CocoaPods combines everything into one target, if the user enables USE_FRAMEWORKS, + * Swift will be available through "#import " otherwise "#import + * "Sentry-Swift.h"". + */ + +@import SentryPrivate; + +#endif diff --git a/Sources/Sentry/include/SentryUIViewControllerSanitizer.h b/Sources/Sentry/include/SentryUIViewControllerSanitizer.h deleted file mode 100644 index e6978d517db..00000000000 --- a/Sources/Sentry/include/SentryUIViewControllerSanitizer.h +++ /dev/null @@ -1,26 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * An auxiliary class to extract information from UIViewController. - */ -@interface SentryUIViewControllerSanitizer : NSObject - -/** - * Retrieve the view controller class name - * and remove unwanted characters from it. - * - * The default description of a object - * is "" - * This method returns only MODULE.CLASSNAME - * - * @param controller A view controller to retrieve the class name. - * - * @return The view controller sanitized class name. - */ -+ (NSString *)sanitizeViewControllerName:(id)controller; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sources/Swift/Sentry.swift b/Sources/Swift/Sentry.swift new file mode 100644 index 00000000000..4ff587d1147 --- /dev/null +++ b/Sources/Swift/Sentry.swift @@ -0,0 +1,3 @@ +//This file is only necessary to make Sentry framework compile using swift compiler. +//This file target membership must be 'Sentry'. +import Foundation diff --git a/Sources/Swift/SwiftDescriptor.swift b/Sources/Swift/SwiftDescriptor.swift new file mode 100644 index 00000000000..9d330c92807 --- /dev/null +++ b/Sources/Swift/SwiftDescriptor.swift @@ -0,0 +1,11 @@ +import Foundation + +@objc +public class SwiftDescriptor: NSObject { + + @objc + public static func getObjectClassName(_ object: AnyObject) -> String { + return String(describing: type(of: object)) + } + +} diff --git a/Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift b/Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift index 2dde33b2e80..15d81d40ba5 100644 --- a/Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift +++ b/Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift @@ -111,15 +111,15 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase { let frame1 = Sentry.Frame() frame1.function = "Second_frame_function" - let thread1 = Sentry.Thread(threadId: 0) - thread1.stacktrace = Stacktrace(frames: [frame1], registers: [:]) + let thread1 = SentryThread(threadId: 0) + thread1.stacktrace = SentryStacktrace(frames: [frame1], registers: [:]) thread1.current = true let frame2 = Sentry.Frame() frame2.function = "main" - let thread2 = Sentry.Thread(threadId: 1) - thread2.stacktrace = Stacktrace(frames: [frame2], registers: [:]) + let thread2 = SentryThread(threadId: 1) + thread2.stacktrace = SentryStacktrace(frames: [frame2], registers: [:]) thread2.current = false threadInspector.allThreads = [ diff --git a/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerPerformanceTrackerTests.swift b/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerPerformanceTrackerTests.swift index 928cd33d793..8f986e65f69 100644 --- a/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerPerformanceTrackerTests.swift +++ b/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerPerformanceTrackerTests.swift @@ -41,7 +41,7 @@ class SentryUIViewControllerPerformanceTrackerTests: XCTestCase { func getSut() -> SentryUIViewControllerPerformanceTracker { CurrentDate.setCurrentDateProvider(dateProvider) - viewControllerName = SentryUIViewControllerSanitizer.sanitizeViewControllerName(viewController) + viewControllerName = SwiftDescriptor.getObjectClassName(viewController) let result = SentryUIViewControllerPerformanceTracker.shared Dynamic(result).tracker = self.tracker diff --git a/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerSwizzlingTests.swift b/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerSwizzlingTests.swift index c820ce4325d..5557569a1eb 100644 --- a/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerSwizzlingTests.swift +++ b/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerSwizzlingTests.swift @@ -93,7 +93,7 @@ class SentryUIViewControllerSwizzlingTests: XCTestCase { XCTAssertNotNil(span) let transactionName = Dynamic(span).transactionContext.name.asString - let expectedTransactionName = SentryUIViewControllerSanitizer.sanitizeViewControllerName(controller) + let expectedTransactionName = SwiftDescriptor.getObjectClassName(controller) XCTAssertEqual(expectedTransactionName, transactionName) } diff --git a/Tests/SentryTests/Protocol/SentryThreadEquality.swift b/Tests/SentryTests/Protocol/SentryThreadEquality.swift index 9731009056d..9e4414c22cd 100644 --- a/Tests/SentryTests/Protocol/SentryThreadEquality.swift +++ b/Tests/SentryTests/Protocol/SentryThreadEquality.swift @@ -1,8 +1,8 @@ import Foundation -extension Sentry.Thread { +extension SentryThread { open override func isEqual(_ object: Any?) -> Bool { - if let other = object as? Sentry.Thread { + if let other = object as? SentryThread { return threadId == other.threadId && name == other.name && stacktrace == other.stacktrace && @@ -17,9 +17,9 @@ extension Sentry.Thread { } } -extension Sentry.Stacktrace { +extension SentryStacktrace { open override func isEqual(_ object: Any?) -> Bool { - if let other = object as? Sentry.Stacktrace { + if let other = object as? SentryStacktrace { return frames == other.frames && registers == other.registers } else { diff --git a/Tests/SentryTests/Protocol/TestData.swift b/Tests/SentryTests/Protocol/TestData.swift index 64177f526d2..df2a15ebeaa 100644 --- a/Tests/SentryTests/Protocol/TestData.swift +++ b/Tests/SentryTests/Protocol/TestData.swift @@ -120,8 +120,8 @@ class TestData { return mechanismMeta } - static var thread: Sentry.Thread { - let thread = Sentry.Thread(threadId: 10) + static var thread: SentryThread { + let thread = SentryThread(threadId: 10) thread.crashed = false thread.current = true thread.name = "main" @@ -130,8 +130,8 @@ class TestData { return thread } - static var stacktrace: Stacktrace { - let stacktrace = Stacktrace(frames: [frame], registers: ["register": "one"]) + static var stacktrace: SentryStacktrace { + let stacktrace = SentryStacktrace(frames: [frame], registers: ["register": "one"]) stacktrace.snapshot = true return stacktrace } diff --git a/Tests/SentryTests/SentryClientTests.swift b/Tests/SentryTests/SentryClientTests.swift index c3e0f5359f2..73036e37aa5 100644 --- a/Tests/SentryTests/SentryClientTests.swift +++ b/Tests/SentryTests/SentryClientTests.swift @@ -1261,7 +1261,7 @@ class SentryClientTest: XCTestCase { private func givenEventWithThreads() -> Event { let event = Event(level: SentryLevel.fatal) - let thread = Sentry.Thread(threadId: 1) + let thread = SentryThread(threadId: 1) thread.crashed = true let threads = [thread] event.threads = threads @@ -1360,13 +1360,13 @@ class SentryClientTest: XCTestCase { } } - private func assertValidDebugMeta(actual: [DebugMeta]?, forThreads threads: [Sentry.Thread]?) { + private func assertValidDebugMeta(actual: [DebugMeta]?, forThreads threads: [SentryThread]?) { let debugMetas = fixture.debugImageBuilder.getDebugImages(for: threads ?? []) XCTAssertEqual(debugMetas, actual ?? []) } - private func assertValidThreads(actual: [Sentry.Thread]?) { + private func assertValidThreads(actual: [SentryThread]?) { let expected = fixture.threadInspector.getCurrentThreads() XCTAssertEqual(expected.count, actual?.count) XCTAssertEqual(expected, actual) diff --git a/Tests/SentryTests/SentryCrash/SentryDebugImageProviderTests.swift b/Tests/SentryTests/SentryCrash/SentryDebugImageProviderTests.swift index 9d0f45efe30..406d14e3fea 100644 --- a/Tests/SentryTests/SentryCrash/SentryDebugImageProviderTests.swift +++ b/Tests/SentryTests/SentryCrash/SentryDebugImageProviderTests.swift @@ -122,10 +122,10 @@ class SentryDebugImageProviderTests: XCTestCase { func testImagesForThreads() { let sut = fixture.getSut(images: fixture.getTestImages()) - let thread = Sentry.Thread(threadId: NSNumber(value: 1)) + let thread = SentryThread(threadId: NSNumber(value: 1)) let frame = Sentry.Frame() frame.imageAddress = "0x0000000105705000" - thread.stacktrace = Stacktrace(frames: [frame], registers: [:]) + thread.stacktrace = SentryStacktrace(frames: [frame], registers: [:]) var actual = sut.getDebugImages(for: [thread]) @@ -137,7 +137,7 @@ class SentryDebugImageProviderTests: XCTestCase { frame2.imageAddress = "0x00000001410b1a00" let frame3 = Sentry.Frame() frame3.imageAddress = "0x000000017ca5e400" - thread.stacktrace = Stacktrace(frames: [frame2, frame3], registers: [:]) + thread.stacktrace = SentryStacktrace(frames: [frame2, frame3], registers: [:]) actual = sut.getDebugImages(for: [thread]) @@ -151,7 +151,7 @@ class SentryDebugImageProviderTests: XCTestCase { func test_NoImage_ForThread_WithoutStackTrace() { let sut = fixture.getSut(images: fixture.getTestImages()) - let thread = Sentry.Thread(threadId: NSNumber(value: 1)) + let thread = SentryThread(threadId: NSNumber(value: 1)) let actual = sut.getDebugImages(for: [thread]) XCTAssertEqual(actual.count, 0) diff --git a/Tests/SentryTests/SentryCrash/SentryThreadInspectorTests.swift b/Tests/SentryTests/SentryCrash/SentryThreadInspectorTests.swift index 4c3624266ce..fcf32564fc6 100644 --- a/Tests/SentryTests/SentryCrash/SentryThreadInspectorTests.swift +++ b/Tests/SentryTests/SentryCrash/SentryThreadInspectorTests.swift @@ -173,9 +173,9 @@ import XCTest private class TestSentryStacktraceBuilder: SentryStacktraceBuilder { - var stackTraces = [SentryCrashThread: Stacktrace]() - override func buildStacktrace(forThread thread: SentryCrashThread, context: OpaquePointer) -> Stacktrace { - return stackTraces[thread] ?? Stacktrace(frames: [], registers: [:]) + var stackTraces = [SentryCrashThread: SentryStacktrace]() + override func buildStacktrace(forThread thread: SentryCrashThread, context: OpaquePointer) -> SentryStacktrace { + return stackTraces[thread] ?? SentryStacktrace(frames: [], registers: [:]) } } diff --git a/Tests/SentryTests/SentryCrash/TestThreadInspector.swift b/Tests/SentryTests/SentryCrash/TestThreadInspector.swift index 6dc623e7091..3996ed7b93a 100644 --- a/Tests/SentryTests/SentryCrash/TestThreadInspector.swift +++ b/Tests/SentryTests/SentryCrash/TestThreadInspector.swift @@ -2,7 +2,7 @@ import Foundation class TestThreadInspector: SentryThreadInspector { - var allThreads: [Sentry.Thread]? + var allThreads: [SentryThread]? static var instance: TestThreadInspector { // We need something to pass to the super initializer, because the empty initializer has been marked unavailable. @@ -12,11 +12,11 @@ class TestThreadInspector: SentryThreadInspector { return TestThreadInspector(stacktraceBuilder: stacktraceBuilder, andMachineContextWrapper: SentryCrashDefaultMachineContextWrapper()) } - override func getCurrentThreads() -> [Sentry.Thread] { + override func getCurrentThreads() -> [SentryThread] { return allThreads ?? [TestData.thread] } - override func getCurrentThreadsWithStackTrace() -> [Sentry.Thread] { + override func getCurrentThreadsWithStackTrace() -> [SentryThread] { return allThreads ?? [TestData.thread] } diff --git a/Tests/SentryTests/SentryTests-Bridging-Header.h b/Tests/SentryTests/SentryTests-Bridging-Header.h index 8845fa563b7..ded723e2d3f 100644 --- a/Tests/SentryTests/SentryTests-Bridging-Header.h +++ b/Tests/SentryTests/SentryTests-Bridging-Header.h @@ -160,7 +160,6 @@ #import "SentryUIApplication.h" #import "SentryUIDeviceWrapper.h" #import "SentryUIViewControllerPerformanceTracker.h" -#import "SentryUIViewControllerSanitizer.h" #import "SentryUIViewControllerSwizzling+Test.h" #import "SentryUIViewControllerSwizzling.h" #import "SentryUserFeedback.h" diff --git a/Tests/SentryTests/SentryUIViewControllerSanitizerTests.swift b/Tests/SentryTests/SentryUIViewControllerSanitizerTests.swift index abb3446b49d..2335c34cd80 100644 --- a/Tests/SentryTests/SentryUIViewControllerSanitizerTests.swift +++ b/Tests/SentryTests/SentryUIViewControllerSanitizerTests.swift @@ -1,6 +1,10 @@ import XCTest class SentryUIViewControllerSanitizerTests: XCTestCase { + + private class InnerClass: NSObject { + + } func testSanitizeViewControllerNameWithBaseObject() { let object = NSObject() @@ -16,22 +20,15 @@ class SentryUIViewControllerSanitizerTests: XCTestCase { XCTAssertEqual(name, "SentryOptions") } - func testSanitizeViewControllerNameWithStrings() { - XCTAssertEqual( - "sentry_ios_cocoapods.ViewController", sanitize("") - ) - - XCTAssertEqual( - "sentry_ios_cocoapodsViewController: 0x7fd9201253c0", sanitize("sentry_ios_cocoapodsViewController: 0x7fd9201253c0") - ) - - XCTAssertEqual( - "sentry_ios_cocoapods.ViewController.miau", sanitize("") - ) + func testSanitizeViewControllerNameWithPrivateSwiftClass() { + let object = InnerClass() + let name = sanitize(object) + XCTAssertNotEqual(name, object.description) + XCTAssertEqual(name, "InnerClass") } - private func sanitize(_ name: Any) -> String { - return SentryUIViewControllerSanitizer.sanitizeViewControllerName(name) + private func sanitize(_ name: AnyObject) -> String { + return SwiftDescriptor.getObjectClassName(name) } } diff --git a/develop-docs/README.md b/develop-docs/README.md index d3ddb94d7f8..47ecb42ef71 100644 --- a/develop-docs/README.md +++ b/develop-docs/README.md @@ -135,3 +135,13 @@ iOS 12 opens a risk of introducing bugs, which has already happened in the past, the iOS 12 simulator a try. Related to [GH-2218](https://github.com/getsentry/sentry-cocoa/issues/2218) + +### Adding Swift code in the project + +Date: October 1st 2022 +Contributors: @brustolin + +A Sentry SDK started to be [written in Swift once,](https://github.com/getsentry/raven-swift) but due to ABI not being stable at that time, it got dropped. Since then Swift 5.0 landed and we got ABI stability. We’ve considered adding Swift to our sentry.cocoa SDK since then, but because of some of the trade offs, we’ve postponed that decision. +This changed with our goal to better support SwiftUI. It’s growing in popularity and we need to write code in Swift in order to support it. +SwiftUI support will be available through an additional library, but to support it, we need to be able to demangle Swift class names in Sentry SDK, which can be done by using Swift API. +Since we support SPM, and SPM doesn't support multi-language projects, we need to create two different targets, one with Swift and another with Objective-C code. Because of that, our Swift code in SPM resides in a different module, which requires a different import in projects, and for now, this is the reason we should avoid writing public API in Swift.