diff --git a/.github/workflows/ui-tests-critical.yml b/.github/workflows/ui-tests-critical.yml index a54b365b7aa..3887f7a95d9 100644 --- a/.github/workflows/ui-tests-critical.yml +++ b/.github/workflows/ui-tests-critical.yml @@ -19,10 +19,10 @@ concurrency: jobs: build-sample: name: Build SwiftUITestSample Sample - runs-on: macos-14 + runs-on: macos-15 steps: - uses: actions/checkout@v4 - - run: ./scripts/ci-select-xcode.sh 16 + - run: ./scripts/ci-select-xcode.sh "16.0" - uses: ruby/setup-ruby@v1 with: bundler-cache: true @@ -45,6 +45,7 @@ jobs: # https://github.com/facebook/react-native/blob/24e7f7d25629a7af6d877a0b79fed2faaab96437/.github/actions/maestro-ios/action.yml#L57 MAESTRO_DRIVER_STARTUP_TIMEOUT: 1500000 # 25 min, CI can be slow at times + strategy: fail-fast: false matrix: diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index b6a92863e6b..2573971d6a5 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -61,7 +61,7 @@ jobs: steps: - uses: actions/checkout@v4 - run: ./scripts/ci-select-xcode.sh ${{matrix.xcode}} - + # GitHub Actions sometimes fail to launch the UI tests. Therefore we retry - name: Run Fastlane run: for i in {1..2}; do fastlane ui_tests_ios_swiftui device:"${{matrix.device}}" && break ; done @@ -110,3 +110,22 @@ jobs: path: | ~/Library/Logs/scan/*.log ./fastlane/test_output/** + + ui-tests-swift6: + name: UI Tests for iOS-Swift6 Simulator + runs-on: macos-15 + + steps: + - uses: actions/checkout@v4 + - run: ./scripts/ci-select-xcode.sh "16.0" + - name: Run Fastlane + run: fastlane ui_tests_ios_swift6 + + - name: Archiving Raw Test Logs + uses: actions/upload-artifact@v4 + if: ${{ failure() || cancelled() }} + with: + name: raw-ios-swift-test-output-${{matrix.xcode}}-${{matrix.device}} + path: | + ~/Library/Logs/scan/*.log + ./fastlane/test_output/** diff --git a/CHANGELOG.md b/CHANGELOG.md index daa2b47a87d..fd2e4db9a92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +### Fixes + +- Make `Scope.span` fully thread safe (#4519) ### Features - Transactions for crashes (#4504): Finish the transaction bound to the scope when the app crashes. This __experimental__ feature is disabled by default. You can enable it via the option `enablePersistingTracesWhenCrashing`. @@ -10,6 +13,8 @@ - Keep PropagationContext when cloning scope (#4518) - Session replay transformed view masking (#4529) +- UIViewController with Xcode 16 in debug (#4523). The Xcode 16 build setting [ENABLE_DEBUG_DYLIB](https://developer.apple.com/documentation/xcode/build-settings-reference#Enable-Debug-Dylib-Support), which is turned on by default only in debug, could lead to missing UIViewController traces. +- Concurrency crash with Swift 6 (#4512) ## 8.40.1 diff --git a/Gemfile.lock b/Gemfile.lock index faa0cb25cfe..8b023f82b11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,7 +42,7 @@ GEM aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) - benchmark (0.3.0) + benchmark (0.4.0) bigdecimal (3.1.8) claide (1.1.0) clamp (1.3.2) @@ -266,7 +266,7 @@ GEM ruby-macho (2.5.1) ruby2_keywords (0.0.5) rubyzip (2.3.2) - securerandom (0.3.1) + securerandom (0.3.2) security (0.1.5) signet (0.19.0) addressable (~> 2.8) @@ -276,12 +276,12 @@ GEM simctl (1.6.10) CFPropertyList naturally - slather (2.8.4) + slather (2.8.5) CFPropertyList (>= 2.2, < 4) activesupport clamp (~> 1.3) nokogiri (>= 1.14.3) - xcodeproj (~> 1.25) + xcodeproj (~> 1.27) sysrandom (1.0.5) terminal-notifier (2.0.0) terminal-table (3.0.2) diff --git a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj index d826fbbd72b..e526e9c0b29 100644 --- a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj +++ b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -13,7 +13,6 @@ 629EC8BB2B0B5BAE00858855 /* TriggerAppHang.swift in Sources */ = {isa = PBXBuildFile; fileRef = 629EC8AC2B0B537400858855 /* TriggerAppHang.swift */; }; 62C07D5C2AF3E3F500894688 /* BaseUITest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62C07D5B2AF3E3F500894688 /* BaseUITest.swift */; }; 62C97DBF2CC69B0300DDA204 /* SampleAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 62C97DB92CC69B0200DDA204 /* SampleAssets.xcassets */; }; - 630853532440C60F00DDE4CE /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; }; 637AFDAA243B02760034958B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637AFDA9243B02760034958B /* AppDelegate.swift */; }; 637AFDAE243B02760034958B /* TransactionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637AFDAD243B02760034958B /* TransactionsViewController.swift */; }; 637AFDB1243B02760034958B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 637AFDAF243B02760034958B /* Main.storyboard */; }; @@ -27,9 +26,7 @@ 844DA821282584C300E6B62E /* CoreDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F57BC427BBD787000D09D4 /* CoreDataViewController.swift */; }; 844DA822282584F700E6B62E /* SentryData.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = D845F35927BAD4CC00A4D7A2 /* SentryData.xcdatamodeld */; }; 847670302BAA4AFA001A4E31 /* NSObject+SentryAppSetup.m in Sources */ = {isa = PBXBuildFile; fileRef = 8476702F2BAA4AFA001A4E31 /* NSObject+SentryAppSetup.m */; }; - 848A256B286E3351008A8858 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; }; 848A256D286E3351008A8858 /* fatal-error-binary-images-message2.json in Resources */ = {isa = PBXBuildFile; fileRef = D83A30DF279F1F5C00372D0A /* fatal-error-binary-images-message2.json */; }; - 848A256F286E3351008A8858 /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 84A5D72629D2705000388BFA /* ProfilingUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A5D72529D2705000388BFA /* ProfilingUITests.swift */; }; 84A5D72D29D2708D00388BFA /* UITestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A5D72C29D2708D00388BFA /* UITestHelpers.swift */; }; 84AB90712A5001000054C99A /* ProfilingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AB90702A5001000054C99A /* ProfilingViewController.swift */; }; @@ -55,8 +52,6 @@ D80D021A29EE936F0084393D /* ExtraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80D021929EE936F0084393D /* ExtraViewController.swift */; }; D80D021B29EE9E3D0084393D /* ErrorsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80D021229EE93630084393D /* ErrorsViewController.swift */; }; D80D021C29EE9E400084393D /* ExtraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80D021929EE936F0084393D /* ExtraViewController.swift */; }; - D8105B61297E824C00299F03 /* SentrySwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8105B5C297E792200299F03 /* SentrySwiftUI.framework */; }; - D8105B62297E824C00299F03 /* SentrySwiftUI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D8105B5C297E792200299F03 /* SentrySwiftUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8269A3C274C095E00BD5BD5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8269A3B274C095E00BD5BD5 /* AppDelegate.swift */; }; D8269A3E274C095E00BD5BD5 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8269A3D274C095E00BD5BD5 /* SceneDelegate.swift */; }; D8269A43274C095F00BD5BD5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D8269A41274C095F00BD5BD5 /* Main.storyboard */; }; @@ -68,10 +63,6 @@ D8269A56274C0F9E00BD5BD5 /* NibViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D890CD3B26CEE2FA001246CF /* NibViewController.xib */; }; D8269A57274C0FA100BD5BD5 /* NibViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D890CD3E26CEE31B001246CF /* NibViewController.swift */; }; D8269A58274C0FC700BD5BD5 /* TransactionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637AFDAD243B02760034958B /* TransactionsViewController.swift */; }; - D8269A59274C100300BD5BD5 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; }; - D8269A5A274C100300BD5BD5 /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - D83A30D8279F159D00372D0A /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - D83A30DC279F16BA00372D0A /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; D83A30E1279F1F5C00372D0A /* fatal-error-binary-images-message2.json in Resources */ = {isa = PBXBuildFile; fileRef = D83A30DF279F1F5C00372D0A /* fatal-error-binary-images-message2.json */; }; D840D523273A07F400CDF142 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D840D522273A07F400CDF142 /* AppDelegate.swift */; }; D840D525273A07F400CDF142 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D840D524273A07F400CDF142 /* SceneDelegate.swift */; }; @@ -89,6 +80,16 @@ D8444E57275F795D0042F4DE /* UIViewControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8444E4B275E38090042F4DE /* UIViewControllerExtension.swift */; }; D845F35B27BAD4CC00A4D7A2 /* SentryData.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = D845F35927BAD4CC00A4D7A2 /* SentryData.xcdatamodeld */; }; D85DAA4C274C244F004DF43C /* LaunchUITest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D85DAA4B274C244F004DF43C /* LaunchUITest.swift */; }; + D86B9C972CDD11430039211C /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9C962CDD11430039211C /* Sentry.framework */; }; + D86B9C982CDD11430039211C /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9C962CDD11430039211C /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + D86B9C9A2CDD114E0039211C /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9C992CDD114E0039211C /* Sentry.framework */; }; + D86B9C9B2CDD114E0039211C /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9C992CDD114E0039211C /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + D86B9C9D2CDD115A0039211C /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9C9C2CDD115A0039211C /* Sentry.framework */; }; + D86B9C9E2CDD115A0039211C /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9C9C2CDD115A0039211C /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + D86B9CA02CDD11670039211C /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9C9F2CDD11670039211C /* Sentry.framework */; }; + D86B9CA12CDD11670039211C /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9C9F2CDD11670039211C /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + D86B9CA32CDD136A0039211C /* SentrySwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9CA22CDD136A0039211C /* SentrySwiftUI.framework */; }; + D86B9CA42CDD136A0039211C /* SentrySwiftUI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D86B9CA22CDD136A0039211C /* SentrySwiftUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8832B132AF4F7FE00C522B0 /* TopViewControllerInspector.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8832B122AF4F7FE00C522B0 /* TopViewControllerInspector.swift */; }; D8832B1A2AF5000F00C522B0 /* TopViewControllerInspector.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8832B122AF4F7FE00C522B0 /* TopViewControllerInspector.swift */; }; D8832B1C2AF5101300C522B0 /* TopViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8832B1B2AF5101300C522B0 /* TopViewControllerTests.swift */; }; @@ -98,8 +99,6 @@ D890CD3F26CEE31B001246CF /* NibViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D890CD3E26CEE31B001246CF /* NibViewController.swift */; }; D8AE48C92C57DC2F0092A2A6 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8AE48C82C57DC2F0092A2A6 /* WebViewController.swift */; }; D8AE48CF2C57E0BD0092A2A6 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8AE48C82C57DC2F0092A2A6 /* WebViewController.swift */; }; - D8B56CF0273A8D97004DF238 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; }; - D8B56CF1273A8D97004DF238 /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8BC843E2B021C5200A662B7 /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4F33F7271EBD2500C8591E /* SwiftUIView.swift */; }; D8BCCDE22CAFDE9400E8A030 /* Sample.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = D8BCCDE12CAFDE9400E8A030 /* Sample.xcconfig */; }; D8BCCDE32CAFDE9400E8A030 /* Sample.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = D8BCCDE12CAFDE9400E8A030 /* Sample.xcconfig */; }; @@ -122,31 +121,18 @@ D8F3D05F274E6A8B00B56F8C /* AssertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F3D05E274E6A8B00B56F8C /* AssertView.swift */; }; D8F3D062274EBD4800B56F8C /* SpanExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F3D061274EBD4800B56F8C /* SpanExtension.swift */; }; D8F57BC527BBD787000D09D4 /* CoreDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F57BC427BBD787000D09D4 /* CoreDataViewController.swift */; }; + D8F71A4F2CDD03B900334022 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F71A4E2CDD03B900334022 /* AppDelegate.swift */; }; + D8F71A512CDD03B900334022 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F71A502CDD03B900334022 /* SceneDelegate.swift */; }; + D8F71A532CDD03B900334022 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F71A522CDD03B900334022 /* ViewController.swift */; }; + D8F71A562CDD03B900334022 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = D8F71A552CDD03B900334022 /* Base */; }; + D8F71A582CDD03BB00334022 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D8F71A572CDD03BB00334022 /* Assets.xcassets */; }; + D8F71A5B2CDD03BB00334022 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = D8F71A5A2CDD03BB00334022 /* Base */; }; + D8F71A702CDD03BB00334022 /* UITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F71A6F2CDD03BB00334022 /* UITests.swift */; }; + D8F71A822CDD04C200334022 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; D8FD68C42C1C86E300A70055 /* TableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FD68C32C1C86E300A70055 /* TableViewController.xib */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 630853312440C44F00DDE4CE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 63AA759B1EB8AEF500D153DE; - remoteInfo = Sentry; - }; - 630853332440C44F00DDE4CE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 63AA76651EB8CB2F00D153DE; - remoteInfo = SentryTests; - }; - 630853512440C60800DDE4CE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 63AA759A1EB8AEF500D153DE; - remoteInfo = Sentry; - }; 7B64386D26A6C544000D0F65 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 637AFD9E243B02760034958B /* Project object */; @@ -154,13 +140,6 @@ remoteGlobalIDString = 637AFDA5243B02760034958B; remoteInfo = "iOS-Swift"; }; - 848A2562286E3351008A8858 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 63AA759A1EB8AEF500D153DE; - remoteInfo = Sentry; - }; 848A2564286E3351008A8858 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 637AFD9E243B02760034958B /* Project object */; @@ -168,34 +147,6 @@ remoteGlobalIDString = 637AFDA5243B02760034958B; remoteInfo = "iOS-Swift"; }; - 84B7FA5A29B2A86500AD93B1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 8431EFD929B27B1100D8DC56; - remoteInfo = SentryProfilerTests; - }; - 84B7FA5C29B2A86500AD93B1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 8431F00A29B284F200D8DC56; - remoteInfo = SentryTestUtils; - }; - D8105B5B297E792200299F03 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D8199DAA29376E9B0074249E; - remoteInfo = SentrySwiftUI; - }; - D83A30CA279F075800372D0A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 63AA759A1EB8AEF500D153DE; - remoteInfo = Sentry; - }; D840D532273A07F600CDF142 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 637AFD9E243B02760034958B /* Project object */; @@ -203,13 +154,6 @@ remoteGlobalIDString = D840D51F273A07F400CDF142; remoteInfo = "iOS-SwiftClip"; }; - D84DAD702B177DB2003CF120 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D84DAD4D2B17428D003CF120; - remoteInfo = SentryTestUtilsDynamic; - }; D85DAA4F274C244F004DF43C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 637AFD9E243B02760034958B /* Project object */; @@ -217,6 +161,13 @@ remoteGlobalIDString = D8269A38274C095E00BD5BD5; remoteInfo = "iOS13-Swift"; }; + D8F71A6C2CDD03BB00334022 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 637AFD9E243B02760034958B /* Project object */; + proxyType = 1; + remoteGlobalIDString = D8F71A4B2CDD03B900334022; + remoteInfo = "iOS-Swift6"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -226,7 +177,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - D83A30D8279F159D00372D0A /* Sentry.framework in Embed Frameworks */, + D86B9C982CDD11430039211C /* Sentry.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -237,7 +188,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - D83A30DC279F16BA00372D0A /* Sentry.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -248,7 +198,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 848A256F286E3351008A8858 /* Sentry.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -259,8 +208,8 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - D8269A5A274C100300BD5BD5 /* Sentry.framework in Embed Frameworks */, - D8105B62297E824C00299F03 /* SentrySwiftUI.framework in Embed Frameworks */, + D86B9C9B2CDD114E0039211C /* Sentry.framework in Embed Frameworks */, + D86B9CA42CDD136A0039211C /* SentrySwiftUI.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -282,7 +231,18 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - D8B56CF1273A8D97004DF238 /* Sentry.framework in Embed Frameworks */, + D86B9C9E2CDD115A0039211C /* Sentry.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + D8F71A842CDD04C200334022 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + D86B9CA12CDD11670039211C /* Sentry.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -294,7 +254,6 @@ 629EC8AC2B0B537400858855 /* TriggerAppHang.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TriggerAppHang.swift; sourceTree = ""; }; 62C07D5B2AF3E3F500894688 /* BaseUITest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseUITest.swift; sourceTree = ""; }; 62C97DB92CC69B0200DDA204 /* SampleAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = SampleAssets.xcassets; path = ../SampleAssets.xcassets; sourceTree = ""; }; - 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Sentry.xcodeproj; path = ../../Sentry.xcodeproj; sourceTree = ""; }; 637AFDA6243B02760034958B /* iOS-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS-Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 637AFDA9243B02760034958B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 637AFDAD243B02760034958B /* TransactionsViewController.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = TransactionsViewController.swift; sourceTree = ""; tabWidth = 4; }; @@ -358,6 +317,11 @@ D845F35A27BAD4CC00A4D7A2 /* Person.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Person.xcdatamodel; sourceTree = ""; }; D85DAA49274C244F004DF43C /* iOS13-SwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "iOS13-SwiftTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D85DAA4B274C244F004DF43C /* LaunchUITest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchUITest.swift; sourceTree = ""; }; + D86B9C962CDD11430039211C /* Sentry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Sentry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D86B9C992CDD114E0039211C /* Sentry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Sentry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D86B9C9C2CDD115A0039211C /* Sentry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Sentry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D86B9C9F2CDD11670039211C /* Sentry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Sentry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D86B9CA22CDD136A0039211C /* SentrySwiftUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SentrySwiftUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D8832B122AF4F7FE00C522B0 /* TopViewControllerInspector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopViewControllerInspector.swift; sourceTree = ""; }; D8832B192AF4FE2000C522B0 /* SentryUIApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryUIApplication.h; sourceTree = ""; }; D8832B1B2AF5101300C522B0 /* TopViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopViewControllerTests.swift; sourceTree = ""; }; @@ -383,6 +347,16 @@ D8F3D05E274E6A8B00B56F8C /* AssertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssertView.swift; sourceTree = ""; }; D8F3D061274EBD4800B56F8C /* SpanExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpanExtension.swift; sourceTree = ""; }; D8F57BC427BBD787000D09D4 /* CoreDataViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataViewController.swift; sourceTree = ""; }; + D8F71A4C2CDD03B900334022 /* iOS-Swift6.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS-Swift6.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + D8F71A4E2CDD03B900334022 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D8F71A502CDD03B900334022 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + D8F71A522CDD03B900334022 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + D8F71A552CDD03B900334022 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D8F71A572CDD03BB00334022 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D8F71A5A2CDD03BB00334022 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D8F71A5C2CDD03BB00334022 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D8F71A6B2CDD03BB00334022 /* iOS-Swift6UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "iOS-Swift6UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D8F71A6F2CDD03BB00334022 /* UITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITests.swift; sourceTree = ""; }; D8FD68C32C1C86E300A70055 /* TableViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TableViewController.xib; sourceTree = ""; }; /* End PBXFileReference section */ @@ -391,7 +365,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 630853532440C60F00DDE4CE /* Sentry.framework in Frameworks */, + D86B9C972CDD11430039211C /* Sentry.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -406,7 +380,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 848A256B286E3351008A8858 /* Sentry.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -414,8 +387,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D8269A59274C100300BD5BD5 /* Sentry.framework in Frameworks */, - D8105B61297E824C00299F03 /* SentrySwiftUI.framework in Frameworks */, + D86B9C9A2CDD114E0039211C /* Sentry.framework in Frameworks */, + D86B9CA32CDD136A0039211C /* SentrySwiftUI.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -423,7 +396,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D8B56CF0273A8D97004DF238 /* Sentry.framework in Frameworks */, + D86B9C9D2CDD115A0039211C /* Sentry.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -434,25 +407,33 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D8F71A492CDD03B900334022 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D8F71A822CDD04C200334022 /* (null) in Frameworks */, + D86B9CA02CDD11670039211C /* Sentry.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D8F71A682CDD03BB00334022 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 6308532D2440C44F00DDE4CE /* Products */ = { - isa = PBXGroup; - children = ( - 630853322440C44F00DDE4CE /* Sentry.framework */, - 630853342440C44F00DDE4CE /* SentryTests.xctest */, - D8105B5C297E792200299F03 /* SentrySwiftUI.framework */, - 84B7FA5B29B2A86500AD93B1 /* SentryProfilerTests.xctest */, - 84B7FA5D29B2A86500AD93B1 /* libSentryTestUtils.a */, - D84DAD712B177DB2003CF120 /* SentryTestUtilsDynamic.framework */, - ); - name = Products; - sourceTree = ""; - }; 634C7EC124406A4200AFDE9F /* Frameworks */ = { isa = PBXGroup; children = ( + D86B9CA22CDD136A0039211C /* SentrySwiftUI.framework */, + D86B9C9F2CDD11670039211C /* Sentry.framework */, + D86B9C9C2CDD115A0039211C /* Sentry.framework */, + D86B9C992CDD114E0039211C /* Sentry.framework */, + D86B9C962CDD11430039211C /* Sentry.framework */, ); name = Frameworks; sourceTree = ""; @@ -463,12 +444,13 @@ 62C97DB92CC69B0200DDA204 /* SampleAssets.xcassets */, 84BA72A62C93698E0045B828 /* Shared */, 848A2576286E3490008A8858 /* PerformanceBenchmarks */, - 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */, 637AFDA8243B02760034958B /* iOS-Swift */, 7B64386926A6C544000D0F65 /* iOS-Swift-UITests */, D840D521273A07F400CDF142 /* iOS-SwiftClip */, D8269A3A274C095E00BD5BD5 /* iOS13-Swift */, D85DAA4A274C244F004DF43C /* iOS13-SwiftTests */, + D8F71A4D2CDD03B900334022 /* iOS-Swift6 */, + D8F71A6E2CDD03BB00334022 /* iOS-Swift6UITests */, 637AFDA7243B02760034958B /* Products */, 634C7EC124406A4200AFDE9F /* Frameworks */, ); @@ -485,6 +467,8 @@ D8269A39274C095E00BD5BD5 /* iOS13-Swift.app */, D85DAA49274C244F004DF43C /* iOS13-SwiftTests.xctest */, 848A2573286E3351008A8858 /* PerformanceBenchmarks.xctest */, + D8F71A4C2CDD03B900334022 /* iOS-Swift6.app */, + D8F71A6B2CDD03BB00334022 /* iOS-Swift6UITests.xctest */, ); name = Products; sourceTree = ""; @@ -665,6 +649,28 @@ path = Extensions; sourceTree = ""; }; + D8F71A4D2CDD03B900334022 /* iOS-Swift6 */ = { + isa = PBXGroup; + children = ( + D8F71A4E2CDD03B900334022 /* AppDelegate.swift */, + D8F71A502CDD03B900334022 /* SceneDelegate.swift */, + D8F71A522CDD03B900334022 /* ViewController.swift */, + D8F71A542CDD03B900334022 /* Main.storyboard */, + D8F71A572CDD03BB00334022 /* Assets.xcassets */, + D8F71A592CDD03BB00334022 /* LaunchScreen.storyboard */, + D8F71A5C2CDD03BB00334022 /* Info.plist */, + ); + path = "iOS-Swift6"; + sourceTree = ""; + }; + D8F71A6E2CDD03BB00334022 /* iOS-Swift6UITests */ = { + isa = PBXGroup; + children = ( + D8F71A6F2CDD03BB00334022 /* UITests.swift */, + ); + path = "iOS-Swift6UITests"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -683,7 +689,6 @@ buildRules = ( ); dependencies = ( - 630853522440C60800DDE4CE /* PBXTargetDependency */, D840D533273A07F600CDF142 /* PBXTargetDependency */, ); name = "iOS-Swift"; @@ -705,7 +710,6 @@ buildRules = ( ); dependencies = ( - D83A30CB279F075800372D0A /* PBXTargetDependency */, 7B64386E26A6C544000D0F65 /* PBXTargetDependency */, ); name = "iOS-Swift-UITests"; @@ -727,7 +731,6 @@ buildRules = ( ); dependencies = ( - 848A2561286E3351008A8858 /* PBXTargetDependency */, 848A2563286E3351008A8858 /* PBXTargetDependency */, ); name = PerformanceBenchmarks; @@ -795,13 +798,49 @@ productReference = D85DAA49274C244F004DF43C /* iOS13-SwiftTests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; + D8F71A4B2CDD03B900334022 /* iOS-Swift6 */ = { + isa = PBXNativeTarget; + buildConfigurationList = D8F71A732CDD03BB00334022 /* Build configuration list for PBXNativeTarget "iOS-Swift6" */; + buildPhases = ( + D8F71A482CDD03B900334022 /* Sources */, + D8F71A492CDD03B900334022 /* Frameworks */, + D8F71A4A2CDD03B900334022 /* Resources */, + D8F71A842CDD04C200334022 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "iOS-Swift6"; + productName = "iOS-Swift6"; + productReference = D8F71A4C2CDD03B900334022 /* iOS-Swift6.app */; + productType = "com.apple.product-type.application"; + }; + D8F71A6A2CDD03BB00334022 /* iOS-Swift6UITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D8F71A7D2CDD03BB00334022 /* Build configuration list for PBXNativeTarget "iOS-Swift6UITests" */; + buildPhases = ( + D8F71A672CDD03BB00334022 /* Sources */, + D8F71A682CDD03BB00334022 /* Frameworks */, + D8F71A692CDD03BB00334022 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D8F71A6D2CDD03BB00334022 /* PBXTargetDependency */, + ); + name = "iOS-Swift6UITests"; + productName = "iOS-Swift6UITests"; + productReference = D8F71A6B2CDD03BB00334022 /* iOS-Swift6UITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 637AFD9E243B02760034958B /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1310; + LastSwiftUpdateCheck = 1540; LastUpgradeCheck = 1200; ORGANIZATIONNAME = Sentry; TargetAttributes = { @@ -826,10 +865,17 @@ CreatedOnToolsVersion = 13.1; TestTargetID = D8269A38274C095E00BD5BD5; }; + D8F71A4B2CDD03B900334022 = { + CreatedOnToolsVersion = 15.4; + }; + D8F71A6A2CDD03BB00334022 = { + CreatedOnToolsVersion = 15.4; + TestTargetID = D8F71A4B2CDD03B900334022; + }; }; }; buildConfigurationList = 637AFDA1243B02760034958B /* Build configuration list for PBXProject "iOS-Swift" */; - compatibilityVersion = "Xcode 9.3"; + compatibilityVersion = "Xcode 15.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -841,12 +887,6 @@ ); productRefGroup = 637AFDA7243B02760034958B /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 6308532D2440C44F00DDE4CE /* Products */; - ProjectRef = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */; - }, - ); projectRoot = ""; targets = ( 637AFDA5243B02760034958B /* iOS-Swift */, @@ -855,55 +895,12 @@ D840D51F273A07F400CDF142 /* iOS-SwiftClip */, D8269A38274C095E00BD5BD5 /* iOS13-Swift */, D85DAA48274C244F004DF43C /* iOS13-SwiftTests */, + D8F71A4B2CDD03B900334022 /* iOS-Swift6 */, + D8F71A6A2CDD03BB00334022 /* iOS-Swift6UITests */, ); }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 630853322440C44F00DDE4CE /* Sentry.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Sentry.framework; - remoteRef = 630853312440C44F00DDE4CE /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 630853342440C44F00DDE4CE /* SentryTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = SentryTests.xctest; - remoteRef = 630853332440C44F00DDE4CE /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 84B7FA5B29B2A86500AD93B1 /* SentryProfilerTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = SentryProfilerTests.xctest; - remoteRef = 84B7FA5A29B2A86500AD93B1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 84B7FA5D29B2A86500AD93B1 /* libSentryTestUtils.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libSentryTestUtils.a; - remoteRef = 84B7FA5C29B2A86500AD93B1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - D8105B5C297E792200299F03 /* SentrySwiftUI.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SentrySwiftUI.framework; - remoteRef = D8105B5B297E792200299F03 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - D84DAD712B177DB2003CF120 /* SentryTestUtilsDynamic.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SentryTestUtilsDynamic.framework; - remoteRef = D84DAD702B177DB2003CF120 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ 637AFDA4243B02760034958B /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -966,6 +963,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D8F71A4A2CDD03B900334022 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D8F71A582CDD03BB00334022 /* Assets.xcassets in Resources */, + D8F71A5B2CDD03BB00334022 /* Base in Resources */, + D8F71A562CDD03B900334022 /* Base in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D8F71A692CDD03BB00334022 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -1207,34 +1221,37 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D8F71A482CDD03B900334022 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D8F71A532CDD03B900334022 /* ViewController.swift in Sources */, + D8F71A4F2CDD03B900334022 /* AppDelegate.swift in Sources */, + D8F71A512CDD03B900334022 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D8F71A672CDD03BB00334022 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D8F71A702CDD03BB00334022 /* UITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 630853522440C60800DDE4CE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Sentry; - targetProxy = 630853512440C60800DDE4CE /* PBXContainerItemProxy */; - }; 7B64386E26A6C544000D0F65 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 637AFDA5243B02760034958B /* iOS-Swift */; targetProxy = 7B64386D26A6C544000D0F65 /* PBXContainerItemProxy */; }; - 848A2561286E3351008A8858 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Sentry; - targetProxy = 848A2562286E3351008A8858 /* PBXContainerItemProxy */; - }; 848A2563286E3351008A8858 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 637AFDA5243B02760034958B /* iOS-Swift */; targetProxy = 848A2564286E3351008A8858 /* PBXContainerItemProxy */; }; - D83A30CB279F075800372D0A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Sentry; - targetProxy = D83A30CA279F075800372D0A /* PBXContainerItemProxy */; - }; D840D533273A07F600CDF142 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D840D51F273A07F400CDF142 /* iOS-SwiftClip */; @@ -1245,6 +1262,11 @@ target = D8269A38274C095E00BD5BD5 /* iOS13-Swift */; targetProxy = D85DAA4F274C244F004DF43C /* PBXContainerItemProxy */; }; + D8F71A6D2CDD03BB00334022 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D8F71A4B2CDD03B900334022 /* iOS-Swift6 */; + targetProxy = D8F71A6C2CDD03BB00334022 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -1288,6 +1310,22 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; + D8F71A542CDD03B900334022 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D8F71A552CDD03B900334022 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D8F71A592CDD03BB00334022 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D8F71A5A2CDD03BB00334022 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -2241,6 +2279,240 @@ }; name = Release; }; + D8F71A742CDD03BB00334022 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "iOS-Swift6/Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.iOS-Swift6"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 6.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D8F71A752CDD03BB00334022 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "iOS-Swift6/Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.iOS-Swift6"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 6.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + D8F71A762CDD03BB00334022 /* TestCI */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "iOS-Swift6/Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.iOS-Swift6"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 6.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = TestCI; + }; + D8F71A772CDD03BB00334022 /* Test */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "iOS-Swift6/Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.iOS-Swift6"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 6.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Test; + }; + D8F71A7E2CDD03BB00334022 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.iOS-Swift6UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "iOS-Swift6"; + }; + name = Debug; + }; + D8F71A7F2CDD03BB00334022 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.iOS-Swift6UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "iOS-Swift6"; + }; + name = Release; + }; + D8F71A802CDD03BB00334022 /* TestCI */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.iOS-Swift6UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "iOS-Swift6"; + }; + name = TestCI; + }; + D8F71A812CDD03BB00334022 /* Test */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.iOS-Swift6UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "iOS-Swift6"; + }; + name = Test; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -2321,6 +2593,28 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D8F71A732CDD03BB00334022 /* Build configuration list for PBXNativeTarget "iOS-Swift6" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D8F71A742CDD03BB00334022 /* Debug */, + D8F71A752CDD03BB00334022 /* Release */, + D8F71A762CDD03BB00334022 /* TestCI */, + D8F71A772CDD03BB00334022 /* Test */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D8F71A7D2CDD03BB00334022 /* Build configuration list for PBXNativeTarget "iOS-Swift6UITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D8F71A7E2CDD03BB00334022 /* Debug */, + D8F71A7F2CDD03BB00334022 /* Release */, + D8F71A802CDD03BB00334022 /* TestCI */, + D8F71A812CDD03BB00334022 /* Test */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCVersionGroup section */ diff --git a/Samples/iOS-Swift/iOS-Swift.xcodeproj/xcshareddata/xcschemes/iOS-Swift6.xcscheme b/Samples/iOS-Swift/iOS-Swift.xcodeproj/xcshareddata/xcschemes/iOS-Swift6.xcscheme new file mode 100644 index 00000000000..5e406c71dea --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift.xcodeproj/xcshareddata/xcschemes/iOS-Swift6.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/iOS-Swift/iOS-Swift6/AppDelegate.swift b/Samples/iOS-Swift/iOS-Swift6/AppDelegate.swift new file mode 100644 index 00000000000..a5f03803104 --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/AppDelegate.swift @@ -0,0 +1,48 @@ +import Sentry +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + func startSentry() { + SentrySDK.start(configureOptions: { options in + options.dsn = "https://6cc9bae94def43cab8444a99e0031c28@o447951.ingest.sentry.io/5428557" + options.beforeSend = { event in + print("Sentry: beforeSend called") + return event + } + options.beforeSendSpan = { span in + print("Sentry: beforeSendSpan called") + return span + } + options.beforeCaptureScreenshot = { _ in + print("Sentry: beforeCaptureScreenshot called") + return true + } + options.beforeCaptureViewHierarchy = { _ in + print("Sentry: beforeCaptureViewHierarchy called") + return true + } + options.attachScreenshot = true + options.attachViewHierarchy = true + options.debug = true + options.sampleRate = 1 + options.tracesSampleRate = 1 + }) + + } + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + startSentry() + return true + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + } + +} diff --git a/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/AccentColor.colorset/Contents.json b/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000000..eb878970081 --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/AppIcon.appiconset/Contents.json b/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000000..2305880107d --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/Contents.json b/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/Contents.json new file mode 100644 index 00000000000..73c00596a7f --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Samples/iOS-Swift/iOS-Swift6/Base.lproj/LaunchScreen.storyboard b/Samples/iOS-Swift/iOS-Swift6/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000000..865e9329f37 --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/iOS-Swift/iOS-Swift6/Base.lproj/Main.storyboard b/Samples/iOS-Swift/iOS-Swift6/Base.lproj/Main.storyboard new file mode 100644 index 00000000000..d807513902f --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/Base.lproj/Main.storyboard @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/iOS-Swift/iOS-Swift6/Info.plist b/Samples/iOS-Swift/iOS-Swift6/Info.plist new file mode 100644 index 00000000000..dd3c9afdae3 --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/Samples/iOS-Swift/iOS-Swift6/SceneDelegate.swift b/Samples/iOS-Swift/iOS-Swift6/SceneDelegate.swift new file mode 100644 index 00000000000..84d9608c49d --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/SceneDelegate.swift @@ -0,0 +1,24 @@ +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + } + + func sceneDidBecomeActive(_ scene: UIScene) { + } + + func sceneWillResignActive(_ scene: UIScene) { + } + + func sceneWillEnterForeground(_ scene: UIScene) { + } + + func sceneDidEnterBackground(_ scene: UIScene) { + } +} diff --git a/Samples/iOS-Swift/iOS-Swift6/ViewController.swift b/Samples/iOS-Swift/iOS-Swift6/ViewController.swift new file mode 100644 index 00000000000..9011b271fb8 --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6/ViewController.swift @@ -0,0 +1,10 @@ +import Sentry +import UIKit + +class ViewController: UIViewController { + @IBAction func buttonTapped(_ sender: Any) { + DispatchQueue.global(qos: .utility).async { + SentrySDK.capture(error: NSError(domain: "Swift 6 Test", code: -1)) + } + } +} diff --git a/Samples/iOS-Swift/iOS-Swift6UITests/UITests.swift b/Samples/iOS-Swift/iOS-Swift6UITests/UITests.swift new file mode 100644 index 00000000000..104beedf60e --- /dev/null +++ b/Samples/iOS-Swift/iOS-Swift6UITests/UITests.swift @@ -0,0 +1,15 @@ +import XCTest + +final class UITests: XCTestCase { + + override func setUpWithError() throws { + continueAfterFailure = false + } + + @MainActor + func testLauchAndCaptureError() throws { + let app = XCUIApplication() + app.launch() + app.buttons["btError"].tap() + } +} diff --git a/Sources/Sentry/PrivateSentrySDKOnly.mm b/Sources/Sentry/PrivateSentrySDKOnly.mm index b5ab0ace5ea..5604cd0deaf 100644 --- a/Sources/Sentry/PrivateSentrySDKOnly.mm +++ b/Sources/Sentry/PrivateSentrySDKOnly.mm @@ -357,6 +357,19 @@ + (void)addReplayRedactClasses:(NSArray *_Nonnull)classes { [[PrivateSentrySDKOnly getReplayIntegration].viewPhotographer addRedactClasses:classes]; } + ++ (void)setIgnoreContainerClass:(Class _Nonnull)containerClass +{ + [[PrivateSentrySDKOnly getReplayIntegration].viewPhotographer + setIgnoreContainerClass:containerClass]; +} + ++ (void)setRedactContainerClass:(Class _Nonnull)containerClass +{ + [[PrivateSentrySDKOnly getReplayIntegration].viewPhotographer + setRedactContainerClass:containerClass]; +} + #endif @end diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index 4ec7bd9a667..e5aff0f1b88 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -142,25 +142,27 @@ NS_SWIFT_NAME(Options) /** * This block can be used to modify the event before it will be serialized and sent. */ -@property (nullable, nonatomic, copy) SentryBeforeSendEventCallback beforeSend; +@property (nullable, nonatomic, copy) SentryBeforeSendEventCallback beforeSend NS_SWIFT_SENDABLE; /** * Use this callback to drop or modify a span before the SDK sends it to Sentry. Return @c nil to * drop the span. */ -@property (nullable, nonatomic, copy) SentryBeforeSendSpanCallback beforeSendSpan; +@property (nullable, nonatomic, copy) SentryBeforeSendSpanCallback beforeSendSpan NS_SWIFT_SENDABLE; /** * This block can be used to modify the event before it will be serialized and sent. */ -@property (nullable, nonatomic, copy) SentryBeforeBreadcrumbCallback beforeBreadcrumb; +@property (nullable, nonatomic, copy) + SentryBeforeBreadcrumbCallback beforeBreadcrumb NS_SWIFT_SENDABLE; /** * You can use this callback to decide if the SDK should capture a screenshot or not. Return @c true * if the SDK should capture a screenshot, return @c false if not. This callback doesn't work for * crashes. */ -@property (nullable, nonatomic, copy) SentryBeforeCaptureScreenshotCallback beforeCaptureScreenshot; +@property (nullable, nonatomic, copy) + SentryBeforeCaptureScreenshotCallback beforeCaptureScreenshot NS_SWIFT_SENDABLE; /** * You can use this callback to decide if the SDK should capture a view hierarchy or not. Return @c @@ -168,7 +170,7 @@ NS_SWIFT_NAME(Options) * work for crashes. */ @property (nullable, nonatomic, copy) - SentryBeforeCaptureScreenshotCallback beforeCaptureViewHierarchy; + SentryBeforeCaptureScreenshotCallback beforeCaptureViewHierarchy NS_SWIFT_SENDABLE; /** * A block called shortly after the initialization of the SDK when the last program execution @@ -180,7 +182,8 @@ NS_SWIFT_NAME(Options) * @warning It is not guaranteed that this is called on the main thread. * @note Crash reporting is automatically disabled if a debugger is attached. */ -@property (nullable, nonatomic, copy) SentryOnCrashedLastRunCallback onCrashedLastRun; +@property (nullable, nonatomic, copy) + SentryOnCrashedLastRunCallback onCrashedLastRun NS_SWIFT_SENDABLE; /** * Array of integrations to install. @@ -411,7 +414,7 @@ NS_SWIFT_NAME(Options) * with @c SentrySamplingContext.forNextAppLaunch set to @c YES, and the result will be persisted to * disk for use on the next app launch. */ -@property (nullable, nonatomic) SentryTracesSamplerCallback tracesSampler; +@property (nullable, nonatomic) SentryTracesSamplerCallback tracesSampler NS_SWIFT_SENDABLE; /** * If tracing is enabled or not. @@ -548,7 +551,7 @@ NS_SWIFT_NAME(Options) * disk for use on the next app launch. * @note Profiling is automatically disabled if a thread sanitizer is attached. */ -@property (nullable, nonatomic) SentryTracesSamplerCallback profilesSampler; +@property (nullable, nonatomic) SentryTracesSamplerCallback profilesSampler NS_SWIFT_SENDABLE; /** * If profiling should be enabled or not. diff --git a/Sources/Sentry/SentryBinaryImageCache.m b/Sources/Sentry/SentryBinaryImageCache.m index 0163aa18bbb..fa030edf8bd 100644 --- a/Sources/Sentry/SentryBinaryImageCache.m +++ b/Sources/Sentry/SentryBinaryImageCache.m @@ -141,16 +141,18 @@ - (NSInteger)indexOfImage:(uint64_t)address return -1; // Address not found } -- (nullable NSString *)pathForInAppInclude:(NSString *)inAppInclude +- (NSSet *)imagePathsForInAppInclude:(NSString *)inAppInclude { + NSMutableSet *imagePaths = [NSMutableSet new]; + @synchronized(self) { for (SentryBinaryImageInfo *info in _cache) { if ([SentryInAppLogic isImageNameInApp:info.name inAppInclude:inAppInclude]) { - return info.name; + [imagePaths addObject:info.name]; } } } - return nil; + return imagePaths; } @end diff --git a/Sources/Sentry/SentryPerformanceTracker.m b/Sources/Sentry/SentryPerformanceTracker.m index cf1a3e98c02..322e23d9ce6 100644 --- a/Sources/Sentry/SentryPerformanceTracker.m +++ b/Sources/Sentry/SentryPerformanceTracker.m @@ -61,36 +61,36 @@ - (SentrySpanId *)startSpanWithName:(NSString *)name operation:operation origin:origin]; - [SentrySDK.currentHub.scope useSpan:^(id span) { - BOOL bindToScope = NO; - if (span == nil) { - bindToScope = YES; - } + id span = SentrySDK.currentHub.scope.span; + + BOOL bindToScope = NO; + if (span == nil) { + bindToScope = YES; + } #if SENTRY_HAS_UIKIT - else { - if ([SentryUIEventTracker isUIEventOperation:span.operation]) { - SENTRY_LOG_DEBUG( - @"Cancelling previous UI event span %@", span.spanId.sentrySpanIdString); - [span finishWithStatus:kSentrySpanStatusCancelled]; - bindToScope = YES; - } + else { + if ([SentryUIEventTracker isUIEventOperation:span.operation]) { + SENTRY_LOG_DEBUG( + @"Cancelling previous UI event span %@", span.spanId.sentrySpanIdString); + [span finishWithStatus:kSentrySpanStatusCancelled]; + bindToScope = YES; } + } #endif // SENTRY_HAS_UIKIT - SENTRY_LOG_DEBUG(@"Creating new transaction bound to scope: %d", bindToScope); + SENTRY_LOG_DEBUG(@"Creating new transaction bound to scope: %d", bindToScope); - newSpan = [SentrySDK.currentHub - startTransactionWithContext:context - bindToScope:bindToScope - customSamplingContext:@{} - configuration:[SentryTracerConfiguration configurationWithBlock:^( - SentryTracerConfiguration *configuration) { - configuration.waitForChildren = YES; - configuration.finishMustBeCalled = YES; - }]]; + newSpan = [SentrySDK.currentHub + startTransactionWithContext:context + bindToScope:bindToScope + customSamplingContext:@{} + configuration:[SentryTracerConfiguration configurationWithBlock:^( + SentryTracerConfiguration *configuration) { + configuration.waitForChildren = YES; + configuration.finishMustBeCalled = YES; + }]]; - [(SentryTracer *)newSpan setDelegate:self]; - }]; + [(SentryTracer *)newSpan setDelegate:self]; } SentrySpanId *spanId = newSpan.spanId; diff --git a/Sources/Sentry/SentryScope.m b/Sources/Sentry/SentryScope.m index 354bc3b6a66..b6d4023f75a 100644 --- a/Sources/Sentry/SentryScope.m +++ b/Sources/Sentry/SentryScope.m @@ -59,6 +59,8 @@ @implementation SentryScope { NSObject *_spanLock; } +@synthesize span = _span; + #pragma mark Initializer - (instancetype)initWithMaxBreadcrumbs:(NSInteger)maxBreadcrumbs @@ -150,12 +152,16 @@ - (void)setSpan:(nullable id)span } } -- (void)useSpan:(SentrySpanCallback)callback +- (nullable id)span { - id localSpan = nil; @synchronized(_spanLock) { - localSpan = _span; + return _span; } +} + +- (void)useSpan:(SentrySpanCallback)callback +{ + id localSpan = [self span]; callback(localSpan); } diff --git a/Sources/Sentry/SentrySubClassFinder.m b/Sources/Sentry/SentrySubClassFinder.m index 84bea71325c..261d7596b03 100644 --- a/Sources/Sentry/SentrySubClassFinder.m +++ b/Sources/Sentry/SentrySubClassFinder.m @@ -49,6 +49,8 @@ - (void)actOnSubclassesOfViewControllerInImage:(NSString *)imageName block:(void copyClassNamesForImage:[imageName cStringUsingEncoding:NSUTF8StringEncoding] amount:&count]; + SENTRY_LOG_DEBUG(@"Found %u number of classes in image: %@.", count, imageName); + // Storing the actual classes in an NSArray would call initializer of the class, which we // must avoid as we are on a background thread here and dealing with UIViewControllers, // which assume they are running on the main thread. Therefore, we store the class name @@ -87,9 +89,9 @@ - (void)actOnSubclassesOfViewControllerInImage:(NSString *)imageName block:(void block(NSClassFromString(className)); } - SENTRY_LOG_DEBUG( - @"The following UIViewControllers will generate automatic transactions: %@", - [classesToSwizzle componentsJoinedByString:@", "]); + SENTRY_LOG_DEBUG(@"The following UIViewControllers for image: %@ will generate " + @"automatic transactions: %@", + imageName, [classesToSwizzle componentsJoinedByString:@", "]); }]; }]; } diff --git a/Sources/Sentry/SentryUIViewControllerSwizzling.m b/Sources/Sentry/SentryUIViewControllerSwizzling.m index 6b27feaa4b2..da9bd4f910a 100644 --- a/Sources/Sentry/SentryUIViewControllerSwizzling.m +++ b/Sources/Sentry/SentryUIViewControllerSwizzling.m @@ -79,12 +79,17 @@ - (instancetype)initWithOptions:(SentryOptions *)options - (void)start { for (NSString *inAppInclude in self.inAppLogic.inAppIncludes) { - NSString *pathToImage = [self.binaryImageCache pathForInAppInclude:inAppInclude]; - if (pathToImage != nil) { - [self swizzleUIViewControllersOfImage:pathToImage]; + NSSet *imagePathsToInAppInclude = + [self.binaryImageCache imagePathsForInAppInclude:inAppInclude]; + + if (imagePathsToInAppInclude.count > 0) { + for (NSString *imagePath in imagePathsToInAppInclude) { + [self swizzleUIViewControllersOfImage:imagePath]; + } } else { - SENTRY_LOG_WARN(@"Failed to find the binary image for inAppInclude <%@> and, therefore " - @"can't instrument UIViewControllers in that binary", + SENTRY_LOG_WARN( + @"Failed to find the binary image(s) for inAppInclude <%@> and, therefore " + @"can't instrument UIViewControllers in these binaries.", inAppInclude); } } diff --git a/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h b/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h index 13173b41858..2af2bbb1b34 100644 --- a/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h +++ b/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h @@ -182,6 +182,8 @@ typedef void (^SentryOnAppStartMeasurementAvailable)( + (NSString *__nullable)getReplayId; + (void)addReplayIgnoreClasses:(NSArray *_Nonnull)classes; + (void)addReplayRedactClasses:(NSArray *_Nonnull)classes; ++ (void)setIgnoreContainerClass:(Class _Nonnull)containerClass; ++ (void)setRedactContainerClass:(Class _Nonnull)containerClass; #endif + (nullable NSDictionary *)appStartMeasurementWithSpans; diff --git a/Sources/Sentry/include/HybridPublic/SentryBinaryImageCache.h b/Sources/Sentry/include/HybridPublic/SentryBinaryImageCache.h index fe743f265ed..e4278a5126c 100644 --- a/Sources/Sentry/include/HybridPublic/SentryBinaryImageCache.h +++ b/Sources/Sentry/include/HybridPublic/SentryBinaryImageCache.h @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN - (nullable SentryBinaryImageInfo *)imageByAddress:(const uint64_t)address; -- (nullable NSString *)pathForInAppInclude:(NSString *)inAppInclude; +- (NSSet *)imagePathsForInAppInclude:(NSString *)inAppInclude; + (NSString *_Nullable)convertUUID:(const unsigned char *const)value; diff --git a/Sources/Swift/Tools/SentryViewPhotographer.swift b/Sources/Swift/Tools/SentryViewPhotographer.swift index 0a216a43953..1b71cb2bf2a 100644 --- a/Sources/Swift/Tools/SentryViewPhotographer.swift +++ b/Sources/Swift/Tools/SentryViewPhotographer.swift @@ -113,7 +113,17 @@ class SentryViewPhotographer: NSObject, SentryViewScreenshotProvider { func addRedactClasses(classes: [AnyClass]) { redactBuilder.addRedactClasses(classes) } - + + @objc(setIgnoreContainerClass:) + func setIgnoreContainerClass(_ containerClass: AnyClass) { + redactBuilder.setIgnoreContainerClass(containerClass) + } + + @objc(setRedactContainerClass:) + func setRedactContainerClass(_ containerClass: AnyClass) { + redactBuilder.setRedactContainerClass(containerClass) + } + #if TEST || TESTCI func getRedactBuild() -> UIRedactBuilder { redactBuilder diff --git a/Sources/Swift/Tools/UIRedactBuilder.swift b/Sources/Swift/Tools/UIRedactBuilder.swift index c5aa6c79786..cfa844b1e22 100644 --- a/Sources/Swift/Tools/UIRedactBuilder.swift +++ b/Sources/Swift/Tools/UIRedactBuilder.swift @@ -46,7 +46,11 @@ struct RedactRegion { } class UIRedactBuilder { - + ///This is a wrapper which marks it's direct children to be ignored + private var ignoreContainerClassIdentifier: ObjectIdentifier? + ///This is a wrapper which marks it's direct children to be redacted + private var redactContainerClassIdentifier: ObjectIdentifier? + ///This is a list of UIView subclasses that will be ignored during redact process private var ignoreClassesIdentifiers: Set ///This is a list of UIView subclasses that need to be redacted from screenshot @@ -135,7 +139,27 @@ class UIRedactBuilder { func addRedactClasses(_ redactClasses: [AnyClass]) { redactClasses.forEach(addRedactClass(_:)) } - + + func setIgnoreContainerClass(_ containerClass: AnyClass) { + ignoreContainerClassIdentifier = ObjectIdentifier(containerClass) + } + + func setRedactContainerClass(_ containerClass: AnyClass) { + let id = ObjectIdentifier(containerClass) + redactContainerClassIdentifier = id + redactClassesIdentifiers.insert(id) + } + +#if TEST || TESTCI + func isIgnoreContainerClassTestOnly(_ containerClass: AnyClass) -> Bool { + return isIgnoreContainerClass(containerClass) + } + + func isRedactContainerClassTestOnly(_ containerClass: AnyClass) -> Bool { + return isRedactContainerClass(containerClass) + } +#endif + /** This function identifies and returns the regions within a given UIView that need to be redacted, based on the specified redaction options. @@ -179,9 +203,24 @@ class UIRedactBuilder { } private func shouldIgnore(view: UIView) -> Bool { - return SentryRedactViewHelper.shouldUnmask(view) || containsIgnoreClass(type(of: view)) + return SentryRedactViewHelper.shouldUnmask(view) || containsIgnoreClass(type(of: view)) || shouldIgnoreParentContainer(view) } - + + private func shouldIgnoreParentContainer(_ view: UIView) -> Bool { + guard !isRedactContainerClass(type(of: view)), let parent = view.superview else { return false } + return isIgnoreContainerClass(type(of: parent)) + } + + private func isIgnoreContainerClass(_ containerClass: AnyClass) -> Bool { + guard ignoreContainerClassIdentifier != nil else { return false } + return ObjectIdentifier(containerClass) == ignoreContainerClassIdentifier + } + + private func isRedactContainerClass(_ containerClass: AnyClass) -> Bool { + guard redactContainerClassIdentifier != nil else { return false } + return ObjectIdentifier(containerClass) == redactContainerClassIdentifier + } + private func shouldRedact(view: UIView) -> Bool { if SentryRedactViewHelper.shouldMaskView(view) { return true diff --git a/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerSwizzlingTests.swift b/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerSwizzlingTests.swift index fa4a7cad04c..71c0fbc38c6 100644 --- a/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerSwizzlingTests.swift +++ b/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerSwizzlingTests.swift @@ -25,11 +25,6 @@ class SentryUIViewControllerSwizzlingTests: XCTestCase { cString: class_getImageName(SentryUIViewControllerSwizzlingTests.self)!, encoding: .utf8)! as NSString options.add(inAppInclude: imageName.lastPathComponent) - - let externalImageName = String( - cString: class_getImageName(ExternalUIViewController.self)!, - encoding: .utf8)! as NSString - options.add(inAppInclude: externalImageName.lastPathComponent) } var sut: SentryUIViewControllerSwizzling { @@ -167,6 +162,11 @@ class SentryUIViewControllerSwizzlingTests: XCTestCase { } func testSwizzlingOfExternalLibs() { + let externalImageName = String( + cString: class_getImageName(ExternalUIViewController.self)!, + encoding: .utf8)! as NSString + fixture.options.add(inAppInclude: externalImageName.lastPathComponent) + let sut = fixture.sut sut.start() let controller = ExternalUIViewController() @@ -174,6 +174,47 @@ class SentryUIViewControllerSwizzlingTests: XCTestCase { XCTAssertNotNil(SentrySDK.span) } + func testSwizzleInAppIncludes_WithShortenedInAppInclude() throws { + let imageName = try XCTUnwrap(String( + cString: class_getImageName(ExternalUIViewController.self)!, + encoding: .utf8) as? NSString) + + let lastPathComponent = String(imageName.lastPathComponent) + let shortenedLastPathComponent = String(lastPathComponent.prefix(5)) + + fixture.options.add(inAppInclude: shortenedLastPathComponent) + + let sut = fixture.sut + sut.start() + let controller = ExternalUIViewController() + controller.loadView() + XCTAssertNotNil(SentrySDK.span) + } + + /// Xcode 16 introduces a new flag ENABLE_DEBUG_DYLIB (https://developer.apple.com/documentation/xcode/build-settings-reference#Enable-Debug-Dylib-Support) + /// If this flag is enabled, debug builds of app and app extension targets on supported platforms and SDKs + /// will be built with the main binary code in a separate “NAME.debug.dylib”. + /// This test adds this debug.dylib and checks if it gets swizzled. + func testSwizzle_DebugDylib_GetsSwizzled() { + let imageName = String( + cString: class_getImageName(SentryUIViewControllerSwizzlingTests.self)!, + encoding: .utf8)! as NSString + + let debugDylib = "\(imageName).debug.dylib" + + var image = createCrashBinaryImage(0, name: debugDylib) + SentryDependencyContainer.sharedInstance().binaryImageCache.start() + SentryDependencyContainer.sharedInstance().binaryImageCache.binaryImageAdded(&image) + + let sut = fixture.sut + sut.start() + + let subClassFinderInvocations = fixture.subClassFinder.invocations + let result = subClassFinderInvocations.invocations.filter { $0.imageName == debugDylib } + + XCTAssertEqual(1, result.count) + } + func testSwizzle_fromScene_invalidNotification_NoObject() { let swizzler = fixture.testableSut diff --git a/Tests/SentryTests/PrivateSentrySDKOnlyTests.swift b/Tests/SentryTests/PrivateSentrySDKOnlyTests.swift index 3aa3fdf6d8d..63785d71cf9 100644 --- a/Tests/SentryTests/PrivateSentrySDKOnlyTests.swift +++ b/Tests/SentryTests/PrivateSentrySDKOnlyTests.swift @@ -1,3 +1,4 @@ +@testable import Sentry import SentryTestUtils import XCTest @@ -369,6 +370,42 @@ class PrivateSentrySDKOnlyTests: XCTestCase { PrivateSentrySDKOnly.addReplayRedactClasses([UILabel.self]) } + func testAddIgnoreContainer() throws { + class IgnoreContainer: UIView {} + + SentrySDK.start { + $0.experimental.sessionReplay = SentryReplayOptions(sessionSampleRate: 1, onErrorSampleRate: 1) + $0.setIntegrations([SentrySessionReplayIntegration.self]) + } + + PrivateSentrySDKOnly.setIgnoreContainerClass(IgnoreContainer.self) + + let replayIntegration = try getFirstIntegrationAsReplay() + + let redactBuilder = replayIntegration.viewPhotographer.getRedactBuild() + XCTAssertTrue(redactBuilder.isIgnoreContainerClassTestOnly(IgnoreContainer.self)) + } + + func testAddRedactContainer() throws { + class RedactContainer: UIView {} + + SentrySDK.start { + $0.experimental.sessionReplay = SentryReplayOptions(sessionSampleRate: 1, onErrorSampleRate: 1) + $0.setIntegrations([SentrySessionReplayIntegration.self]) + } + + PrivateSentrySDKOnly.setRedactContainerClass(RedactContainer.self) + + let replayIntegration = try getFirstIntegrationAsReplay() + + let redactBuilder = replayIntegration.viewPhotographer.getRedactBuild() + XCTAssertTrue(redactBuilder.isRedactContainerClassTestOnly(RedactContainer.self)) + } + + private func getFirstIntegrationAsReplay() throws -> SentrySessionReplayIntegration { + return try XCTUnwrap(SentrySDK.currentHub().installedIntegrations().first as? SentrySessionReplayIntegration) + } + let VALID_REPLAY_ID = "0eac7ab503354dd5819b03e263627a29" private class TestSentrySessionReplayIntegration: SentrySessionReplayIntegration { diff --git a/Tests/SentryTests/SentryBinaryImageCacheTests.swift b/Tests/SentryTests/SentryBinaryImageCacheTests.swift index 49717313875..01f45da899b 100644 --- a/Tests/SentryTests/SentryBinaryImageCacheTests.swift +++ b/Tests/SentryTests/SentryBinaryImageCacheTests.swift @@ -122,17 +122,17 @@ class SentryBinaryImageCacheTests: XCTestCase { sut.binaryImageAdded(&binaryImage) sut.binaryImageAdded(&binaryImage2) - let path = sut.pathFor(inAppInclude: "Expected Name at 0") - XCTAssertEqual(path, "Expected Name at 0") + let paths = sut.imagePathsFor(inAppInclude: "Expected Name at 0") + XCTAssertEqual(paths.first, "Expected Name at 0") - let path2 = sut.pathFor(inAppInclude: "Expected Name at 1") - XCTAssertEqual(path2, "Expected Name at 1") + let paths2 = sut.imagePathsFor(inAppInclude: "Expected Name at 1") + XCTAssertEqual(paths2.first, "Expected Name at 1") - let path3 = sut.pathFor(inAppInclude: "Expected") - XCTAssertEqual(path3, "Expected Name at 0") + let bothPaths = sut.imagePathsFor(inAppInclude: "Expected") + XCTAssertEqual(bothPaths, ["Expected Name at 0", "Expected Name at 1"]) - let didNotFind = sut.pathFor(inAppInclude: "Name at 0") - XCTAssertNil(didNotFind) + let didNotFind = sut.imagePathsFor(inAppInclude: "Name at 0") + XCTAssertTrue(didNotFind.isEmpty) } func testBinaryImageWithNULLName_DoesNotAddImage() { @@ -193,7 +193,7 @@ class SentryBinaryImageCacheTests: XCTestCase { for i in 0.. SentryCrashBinaryImage { - let name = "Expected Name at \(address)" - let nameCString = name.withCString { strdup($0) } - - var uuidPointer = UnsafeMutablePointer(nil) - let uuidAsCharArray: [UInt8] = [132, 186, 235, 218, 173, 26, 51, 244, 179, 93, 138, 69, 245, 218, 243, 34] - uuidPointer = UnsafeMutablePointer.allocate(capacity: uuidAsCharArray.count) - uuidPointer?.initialize(from: uuidAsCharArray, count: uuidAsCharArray.count) - - let binaryImage = SentryCrashBinaryImage( - address: UInt64(address), - vmAddress: vmAddress, - size: 100, - name: nameCString, - uuid: uuidPointer, - cpuType: 1, - cpuSubType: 1, - majorVersion: 1, - minorVersion: 0, - revisionVersion: 0, - crashInfoMessage: nil, - crashInfoMessage2: nil - ) - - return binaryImage - } - +func createCrashBinaryImage(_ address: UInt, vmAddress: UInt64 = 0, name: String? = nil) -> SentryCrashBinaryImage { + let imageName = name ?? "Expected Name at \(address)" + let nameCString = imageName.withCString { strdup($0) } + + var uuidPointer = UnsafeMutablePointer(nil) + let uuidAsCharArray: [UInt8] = [132, 186, 235, 218, 173, 26, 51, 244, 179, 93, 138, 69, 245, 218, 243, 34] + uuidPointer = UnsafeMutablePointer.allocate(capacity: uuidAsCharArray.count) + uuidPointer?.initialize(from: uuidAsCharArray, count: uuidAsCharArray.count) + + let binaryImage = SentryCrashBinaryImage( + address: UInt64(address), + vmAddress: vmAddress, + size: 100, + name: nameCString, + uuid: uuidPointer, + cpuType: 1, + cpuSubType: 1, + majorVersion: 1, + minorVersion: 0, + revisionVersion: 0, + crashInfoMessage: nil, + crashInfoMessage2: nil + ) + + return binaryImage } diff --git a/Tests/SentryTests/SentryScopeSwiftTests.swift b/Tests/SentryTests/SentryScopeSwiftTests.swift index edd073f9332..c6037c378d6 100644 --- a/Tests/SentryTests/SentryScopeSwiftTests.swift +++ b/Tests/SentryTests/SentryScopeSwiftTests.swift @@ -281,6 +281,7 @@ class SentryScopeSwiftTests: XCTestCase { func testUseSpanLock_DoesNotBlock_WithBlockingCallback() { let scope = fixture.scope + scope.span = fixture.transaction let queue = DispatchQueue(label: "test-queue", attributes: [.initiallyInactive, .concurrent]) let expect = expectation(description: "useSpan callback is non-blocking") @@ -313,6 +314,7 @@ class SentryScopeSwiftTests: XCTestCase { func testUseSpanLock_IsReentrant() { let expect = expectation(description: "finish on time") let scope = fixture.scope + scope.span = fixture.transaction scope.useSpan { _ in scope.useSpan { _ in expect.fulfill() @@ -322,6 +324,22 @@ class SentryScopeSwiftTests: XCTestCase { wait(for: [expect], timeout: 0.1) } + func testSpan_FromMultipleThreads() { + let scope = fixture.scope + + testConcurrentModifications(asyncWorkItems: 20, writeLoopCount: 10, writeWork: { _ in + + scope.span = SentryTracer(transactionContext: TransactionContext(name: self.fixture.transactionName, operation: self.fixture.transactionOperation), hub: nil) + + scope.useSpan { span in + XCTAssertNotNil(span) + } + + }, readWork: { + XCTAssertNotNil(scope.span) + }) + } + func testMaxBreadcrumbs_IsZero() { let scope = Scope(maxBreadcrumbs: 0) @@ -468,6 +486,8 @@ class SentryScopeSwiftTests: XCTestCase { scope.clearAttachments() scope.addAttachment(TestData.fileAttachment) + scope.span = SentryTracer(transactionContext: TransactionContext(name: self.fixture.transactionName, operation: self.fixture.transactionOperation), hub: nil) + for _ in 0...10 { scope.addBreadcrumb(self.fixture.breadcrumb) } diff --git a/Tests/SentryTests/UIRedactBuilderTests.swift b/Tests/SentryTests/UIRedactBuilderTests.swift index 73cf5b888bc..21d408bb935 100644 --- a/Tests/SentryTests/UIRedactBuilderTests.swift +++ b/Tests/SentryTests/UIRedactBuilderTests.swift @@ -200,7 +200,113 @@ class UIRedactBuilderTests: XCTestCase { let result = sut.redactRegionsFor(view: rootView) XCTAssertEqual(result.count, 1) } - + + func testIgnoreContainerChildView() { + class IgnoreContainer: UIView {} + class AnotherLabel: UILabel {} + + let sut = getSut() + sut.setIgnoreContainerClass(IgnoreContainer.self) + + let ignoreContainer = IgnoreContainer(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) + let wrappedLabel = AnotherLabel(frame: CGRect(x: 20, y: 20, width: 40, height: 40)) + ignoreContainer.addSubview(wrappedLabel) + rootView.addSubview(ignoreContainer) + + let result = sut.redactRegionsFor(view: rootView) + XCTAssertEqual(result.count, 0) + } + + func testIgnoreContainerDirectChildView() { + class IgnoreContainer: UIView {} + class AnotherLabel: UILabel {} + + let sut = getSut() + sut.setIgnoreContainerClass(IgnoreContainer.self) + + let ignoreContainer = IgnoreContainer(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) + let wrappedLabel = AnotherLabel(frame: CGRect(x: 20, y: 20, width: 40, height: 40)) + let redactedLabel = AnotherLabel(frame: CGRect(x: 10, y: 10, width: 10, height: 10)) + wrappedLabel.addSubview(redactedLabel) + ignoreContainer.addSubview(wrappedLabel) + rootView.addSubview(ignoreContainer) + + let result = sut.redactRegionsFor(view: rootView) + XCTAssertEqual(result.count, 1) + } + + func testRedactIgnoreContainerAsChildOfMaskedView() { + class IgnoreContainer: UIView {} + + let sut = getSut() + sut.setIgnoreContainerClass(IgnoreContainer.self) + + let redactedLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) + let ignoreContainer = IgnoreContainer(frame: CGRect(x: 20, y: 20, width: 40, height: 40)) + let redactedChildLabel = UILabel(frame: CGRect(x: 10, y: 10, width: 10, height: 10)) + ignoreContainer.addSubview(redactedChildLabel) + redactedLabel.addSubview(ignoreContainer) + rootView.addSubview(redactedLabel) + + let result = sut.redactRegionsFor(view: rootView) + XCTAssertEqual(result.count, 3) + } + + func testRedactChildrenOfRedactContainer() { + class RedactContainer: UIView {} + class AnotherView: UIView {} + + let sut = getSut() + sut.setRedactContainerClass(RedactContainer.self) + + let redactContainer = RedactContainer(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) + let redactedView = AnotherView(frame: CGRect(x: 20, y: 20, width: 40, height: 40)) + let redactedView2 = AnotherView(frame: CGRect(x: 10, y: 10, width: 10, height: 10)) + redactedView.addSubview(redactedView2) + redactContainer.addSubview(redactedView) + rootView.addSubview(redactContainer) + + let result = sut.redactRegionsFor(view: rootView) + XCTAssertEqual(result.count, 3) + } + + func testRedactChildrenOfRedactedView() { + class AnotherView: UIView {} + + let sut = getSut() + + let redactedLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) + let redactedView = AnotherView(frame: CGRect(x: 20, y: 20, width: 40, height: 40)) + redactedLabel.addSubview(redactedView) + rootView.addSubview(redactedLabel) + + let result = sut.redactRegionsFor(view: rootView) + XCTAssertEqual(result.count, 2) + } + + func testRedactContainerHasPriorityOverIgnoreContainer() { + class IgnoreContainer: UIView {} + class RedactContainer: UIView {} + class AnotherView: UIView {} + + let sut = getSut() + sut.setRedactContainerClass(RedactContainer.self) + + let ignoreContainer = IgnoreContainer(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) + let redactContainer = RedactContainer(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) + let redactedView = AnotherView(frame: CGRect(x: 20, y: 20, width: 40, height: 40)) + let ignoreContainer2 = IgnoreContainer(frame: CGRect(x: 10, y: 10, width: 10, height: 10)) + let redactedView2 = AnotherView(frame: CGRect(x: 15, y: 15, width: 5, height: 5)) + ignoreContainer2.addSubview(redactedView2) + redactedView.addSubview(ignoreContainer2) + redactContainer.addSubview(redactedView) + ignoreContainer.addSubview(redactContainer) + rootView.addSubview(ignoreContainer) + + let result = sut.redactRegionsFor(view: rootView) + XCTAssertEqual(result.count, 4) + } + func testIgnoreView() { class AnotherLabel: UILabel { } diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 853803d8d77..27ae7b6a827 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -206,6 +206,14 @@ platform :ios do configuration: configuration ) end + + lane :ui_tests_ios_swift6 do |options| + run_tests( + workspace: "Sentry.xcworkspace", + scheme: "iOS-Swift6", + configuration: configuration + ) + end lane :ui_tests_ios_objc do run_tests(