diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e5b841f..3987b552 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,6 +38,12 @@ workflows: - build-xcframework-and-app: requires: - validate-code + - build-swift6: + requires: + - validate-code + - build-min-toolchain: + requires: + - validate-code commands: install_dependencies: @@ -85,15 +91,15 @@ commands: steps: - macos/preboot-simulator: platform: "iOS" - device: "iPhone 16" - version: "18.6" + device: "iPhone 18 Pro" + version: "27.0" prestart_tvos_simulator: steps: - macos/preboot-simulator: platform: "tvOS" - device: "Apple TV" - version: "18.5" + device: "Apple TV 4K (3rd generation)" + version: "27.0" parse_and_upload_coverage: description: "Convert .xcresult → Cobertura XML and upload to Codecov" @@ -150,7 +156,7 @@ jobs: validate-code: resource_class: m4pro.medium macos: - xcode: 26.6.0 + xcode: 27.0.0 steps: - checkout @@ -162,11 +168,11 @@ jobs: test-ios-unit: resource_class: m4pro.medium macos: - xcode: 26.6.0 + xcode: 27.0.0 environment: - IOS_DEVICE_NAME: "iPhone 16" - IOS_VERSION: "18.6" + IOS_DEVICE_NAME: "iPhone 18 Pro" + IOS_VERSION: "27.0" steps: - checkout @@ -182,11 +188,11 @@ jobs: test-ios-functional: resource_class: m4pro.medium macos: - xcode: 26.6.0 + xcode: 27.0.0 environment: - IOS_DEVICE_NAME: "iPhone 16" - IOS_VERSION: "18.6" + IOS_DEVICE_NAME: "iPhone 18 Pro" + IOS_VERSION: "27.0" steps: - checkout @@ -202,11 +208,11 @@ jobs: test-ios-integration: resource_class: m4pro.medium macos: - xcode: 26.6.0 + xcode: 27.0.0 environment: - IOS_DEVICE_NAME: "iPhone 16" - IOS_VERSION: "18.6" + IOS_DEVICE_NAME: "iPhone 18 Pro" + IOS_VERSION: "27.0" steps: - checkout @@ -222,11 +228,11 @@ jobs: test-tvos-unit: resource_class: m4pro.medium macos: - xcode: 26.6.0 + xcode: 27.0.0 environment: - TVOS_DEVICE_NAME: "Apple TV" - TVOS_VERSION: "18.5" + TVOS_DEVICE_NAME: "Apple TV 4K (3rd generation)" + TVOS_VERSION: "27.0" steps: - checkout @@ -242,11 +248,11 @@ jobs: test-tvos-functional: resource_class: m4pro.medium macos: - xcode: 26.6.0 + xcode: 27.0.0 environment: - TVOS_DEVICE_NAME: "Apple TV" - TVOS_VERSION: "18.5" + TVOS_DEVICE_NAME: "Apple TV 4K (3rd generation)" + TVOS_VERSION: "27.0" steps: - checkout @@ -262,7 +268,7 @@ jobs: build-xcframework-and-app: resource_class: m4pro.medium macos: - xcode: 26.6.0 + xcode: 27.0.0 steps: - checkout @@ -273,3 +279,44 @@ jobs: - run: name: Build Test App command: make build-app + + # Swift 6 language-mode coverage. Selecting Xcode 27 does not select Swift 6 + # mode (checked-in targets are SWIFT_VERSION = 5.0), so this lane builds the + # AEPEdge target in Swift 6 via AEPEDGE_SWIFT_VERSION (referenced only by that + # target), then compiles a Swift 6 consumer that calls the public + # completion-handler APIs with plain closures from @MainActor code. Dependencies + # keep their own declared language modes (matching a real Swift 6 app), so this + # does not force unreleased dependencies into Swift 6. This continuously protects the + # @Sendable / @preconcurrency boundary this PR adds. + # The full Swift 6 consumer *runtime* probe lands with the dependency-minimum + # bump, once the fixed @Sendable AEPCore / AEPEdgeIdentity releases are published. + build-swift6: + resource_class: m4pro.medium + macos: + xcode: 27.0.0 + + steps: + - checkout + - install_dependencies + - run: + name: Build AEPEdge in Swift 6 language mode (dependencies keep their modes) + command: make build-swift6 + - run: + name: Build Swift 6 consumer (plain closures from @MainActor) + command: make test-swift6-consumer + + # Minimum-supported-toolchain coverage. README advertises Xcode 15.3+ / Swift + # 5.10 as the floor; 15.4 is the oldest 15.x image CircleCI still hosts and + # ships the same Swift 5.10 compiler. Compile-only (no iOS 27 runtime) to catch + # accidental use of APIs/features newer than the advertised minimum. + build-min-toolchain: + resource_class: m4pro.medium + macos: + xcode: 15.4.0 + + steps: + - checkout + - install_dependencies + - run: + name: Build SDK on minimum supported toolchain (Xcode 15.4 / Swift 5.10) + command: make build-min-toolchain diff --git a/AEPEdge.podspec b/AEPEdge.podspec index 0d8ddc72..587777af 100644 --- a/AEPEdge.podspec +++ b/AEPEdge.podspec @@ -12,10 +12,10 @@ Pod::Spec.new do |s| s.author = "Adobe Experience Platform SDK Team" s.source = { :git => "https://github.com/adobe/aepsdk-edge-ios.git", :tag => s.version.to_s } - s.ios.deployment_target = '12.0' - s.tvos.deployment_target = '12.0' + s.ios.deployment_target = '15.0' + s.tvos.deployment_target = '15.0' - s.swift_version = '5.1' + s.swift_version = '5.10' s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' } s.dependency 'AEPCore', '>= 5.13.0', '< 6.0.0' diff --git a/AEPEdge.xcodeproj/project.pbxproj b/AEPEdge.xcodeproj/project.pbxproj index 8f30a635..4ce4aef7 100644 --- a/AEPEdge.xcodeproj/project.pbxproj +++ b/AEPEdge.xcodeproj/project.pbxproj @@ -21,24 +21,11 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - DA0A02000000000000000000 /* DeviceAttributesConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01000000000000000000 /* DeviceAttributesConstants.swift */; }; - DA0A02010000000000000000 /* Event+DeviceAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01010000000000000000 /* Event+DeviceAttributes.swift */; }; - DA0A02020000000000000000 /* DeviceAttributesRequestBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01020000000000000000 /* DeviceAttributesRequestBuilder.swift */; }; - DA0A02030000000000000000 /* DeviceAttributesNetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01030000000000000000 /* DeviceAttributesNetworkService.swift */; }; - DA0A020A0000000000000000 /* DeviceAttributesNetworkResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A010A0000000000000000 /* DeviceAttributesNetworkResult.swift */; }; - DA0A02050000000000000000 /* DeviceAttributesHitProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01050000000000000000 /* DeviceAttributesHitProcessor.swift */; }; - DA0A02060000000000000000 /* DeviceAttributesEdgeExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01060000000000000000 /* DeviceAttributesEdgeExtensionTests.swift */; }; - DA0A02070000000000000000 /* DeviceAttributesEdgeStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01070000000000000000 /* DeviceAttributesEdgeStateTests.swift */; }; - DA0A02080000000000000000 /* DeviceAttributesHitProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01080000000000000000 /* DeviceAttributesHitProcessorTests.swift */; }; - DA0A02090000000000000000 /* DeviceAttributesRequestBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01090000000000000000 /* DeviceAttributesRequestBuilderTests.swift */; }; 1CCD27DC245A240F00E912B2 /* ExperienceEventTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CCD27C82458CB8000E912B2 /* ExperienceEventTests.swift */; }; 211BCB8126030DCD00AACFEF /* EdgeDataEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 211BCB8026030DCD00AACFEF /* EdgeDataEntity.swift */; }; 216989652554B39900B2752C /* EdgeHit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 216989642554B39900B2752C /* EdgeHit.swift */; }; 216989782554B61500B2752C /* EdgeHitProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 216989772554B61500B2752C /* EdgeHitProcessor.swift */; }; 216989B32555376A00B2752C /* EdgeHitProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 216989B22555376A00B2752C /* EdgeHitProcessorTests.swift */; }; - BE3A74DB94CCBEDE9F4145DD /* EdgeBundledBatchingConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E742414B220FB400B4D6FDE5 /* EdgeBundledBatchingConfigTests.swift */; }; - E1D6B4700000000000000202 /* EdgeBatchingConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D6B4700000000000000201 /* EdgeBatchingConfigTests.swift */; }; - 5498316E0EF96A187C554E76 /* SharedStateReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F7B22645DB9C48815995C56 /* SharedStateReaderTests.swift */; }; 2198DEE22604F8BE008ADB6A /* Atomic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2198DEE12604F8BE008ADB6A /* Atomic.swift */; }; 2198DEE826050458008ADB6A /* AtomicTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2198DEE726050458008ADB6A /* AtomicTests.swift */; }; 21C0F88A2627B9D9003872DC /* EdgeEndpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C0F8892627B9D9003872DC /* EdgeEndpoint.swift */; }; @@ -46,8 +33,6 @@ 21FFBD5925631E3E00B48A8F /* EdgeEventWarningTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21FFBD5825631E3E00B48A8F /* EdgeEventWarningTests.swift */; }; 21FFBD6C2563321600B48A8F /* EdgeResponseErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21FFBD6B2563321600B48A8F /* EdgeResponseErrorTests.swift */; }; 2D291DA2D58DFDE34F9A607D /* EdgeBatchingHitQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4B4F8439125544300678E /* EdgeBatchingHitQueue.swift */; }; - E1D6B4700000000000000102 /* EdgeBatchingConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D6B4700000000000000101 /* EdgeBatchingConfig.swift */; }; - BADE531EF1F8BA6C24BF8818 /* EdgeBundledBatchingConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 314D898C6438199FBCA790A7 /* EdgeBundledBatchingConfig.swift */; }; 2E1810032ACCB83F0067E444 /* ConfigOverrideTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E1810022ACCB83F0067E444 /* ConfigOverrideTests.swift */; }; 2E1810052ACCBA1B0067E444 /* TestEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E1810042ACCBA1B0067E444 /* TestEnvironment.swift */; }; 2E1810072ACCE5B00067E444 /* TestBase+EdgeHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E1810062ACCE5B00067E444 /* TestBase+EdgeHelpers.swift */; }; @@ -61,6 +46,7 @@ 2EDD05CA286EAA7000229CB2 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D4D5B5852432977F00CAB6E4 /* Preview Assets.xcassets */; }; 2EDD05CB286EAA7000229CB2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D4D5B5822432977F00CAB6E4 /* Assets.xcassets */; }; 423B5033D43ADB49049383FB /* Pods_FunctionalTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B13510405D14B13EFD1B58A /* Pods_FunctionalTests.framework */; }; + 4A634C6534864EEB30CF5A69 /* EdgeEventError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68EF62435DADA4A4D8860D52 /* EdgeEventError.swift */; }; 4C089BC52CF01AA900CB500C /* FunctionalTestConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C089BC42CF01AA900CB500C /* FunctionalTestConstants.swift */; }; 4CBEE5D829D637170084BC50 /* AEPEdge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D444995F2519506B0093B364 /* AEPEdge.framework */; }; 4CBEE5E629D637E90084BC50 /* UpstreamIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CBEE5E229D637E90084BC50 /* UpstreamIntegrationTests.swift */; }; @@ -74,9 +60,13 @@ 4CBEE6232A1577E40084BC50 /* NoConfigFunctionalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CBEE6222A1577E40084BC50 /* NoConfigFunctionalTests.swift */; }; 4CBEE6252A157CB40084BC50 /* SampleFunctionalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CBEE6242A157CB40084BC50 /* SampleFunctionalTests.swift */; }; 4CF7915E2CA526AB003C1FD8 /* IntegrationTestConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CF7915D2CA526AB003C1FD8 /* IntegrationTestConstants.swift */; }; + 5498316E0EF96A187C554E76 /* SharedStateReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F7B22645DB9C48815995C56 /* SharedStateReaderTests.swift */; }; 783A5F4E903F9B6EABA50D23 /* Pods_UnitTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DA0155731FA82D43DA47B93 /* Pods_UnitTests.framework */; }; 7C2745AEA9EC68DD877FE68B /* EdgeBatchingHitQueueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A321A42EE7CD7AC876A8BE8A /* EdgeBatchingHitQueueTests.swift */; }; + 8A317937E7469F58CE8AD84C /* EdgeCallbackWithError.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE3157E3F5ECD3431FDBB351 /* EdgeCallbackWithError.swift */; }; AD7C4869E9DEACAFBC75A127 /* EdgeDataEntityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D0A46E5E96B2F3FFF4F9B26 /* EdgeDataEntityTests.swift */; }; + BADE531EF1F8BA6C24BF8818 /* EdgeBundledBatchingConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 314D898C6438199FBCA790A7 /* EdgeBundledBatchingConfig.swift */; }; + BE3A74DB94CCBEDE9F4145DD /* EdgeBundledBatchingConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E742414B220FB400B4D6FDE5 /* EdgeBundledBatchingConfigTests.swift */; }; BF024B7924C6238C002131E9 /* FakeIdentityExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF024B7824C6238C002131E9 /* FakeIdentityExtension.swift */; }; BF0C09482465E42100892B5D /* TestableEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0C09472465E42100892B5D /* TestableEdge.swift */; }; BF0F924F27476E6C00378913 /* ImplementationDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0F924E27476E6C00378913 /* ImplementationDetails.swift */; }; @@ -121,8 +111,6 @@ D4C6B43A251A76CB0038F4F9 /* ExperienceEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CCD27C52458CB2300E912B2 /* ExperienceEvent.swift */; }; D4C6B43C251A76CB0038F4F9 /* EdgeResponseError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D46553FA246B6FBC00A150E2 /* EdgeResponseError.swift */; }; D4C6B43D251A76CB0038F4F9 /* EdgeEventHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D46553F8246B43B900A150E2 /* EdgeEventHandle.swift */; }; - 4A634C6534864EEB30CF5A69 /* EdgeEventError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68EF62435DADA4A4D8860D52 /* EdgeEventError.swift */; }; - 8A317937E7469F58CE8AD84C /* EdgeCallbackWithError.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE3157E3F5ECD3431FDBB351 /* EdgeCallbackWithError.swift */; }; D4C6B43E251A76CB0038F4F9 /* EdgeRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF947F77243BE16C0057A6CC /* EdgeRequest.swift */; }; D4C6B43F251A76CB0038F4F9 /* EdgeResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = D42FB8DA246261E600E9321C /* EdgeResponse.swift */; }; D4C6B440251A76CB0038F4F9 /* EdgeNetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4000F322459E2300052C536 /* EdgeNetworkService.swift */; }; @@ -149,6 +137,18 @@ D4F74FE72447A8B800379258 /* MockNetworking.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4F74FE62447A8B800379258 /* MockNetworking.swift */; }; D4F74FE92447A92800379258 /* MockURLSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4F74FE82447A92800379258 /* MockURLSession.swift */; }; D4F74FEB2447A94900379258 /* MockTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4F74FEA2447A94900379258 /* MockTask.swift */; }; + DA0A02000000000000000000 /* DeviceAttributesConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01000000000000000000 /* DeviceAttributesConstants.swift */; }; + DA0A02010000000000000000 /* Event+DeviceAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01010000000000000000 /* Event+DeviceAttributes.swift */; }; + DA0A02020000000000000000 /* DeviceAttributesRequestBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01020000000000000000 /* DeviceAttributesRequestBuilder.swift */; }; + DA0A02030000000000000000 /* DeviceAttributesNetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01030000000000000000 /* DeviceAttributesNetworkService.swift */; }; + DA0A02050000000000000000 /* DeviceAttributesHitProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01050000000000000000 /* DeviceAttributesHitProcessor.swift */; }; + DA0A02060000000000000000 /* DeviceAttributesEdgeExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01060000000000000000 /* DeviceAttributesEdgeExtensionTests.swift */; }; + DA0A02070000000000000000 /* DeviceAttributesEdgeStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01070000000000000000 /* DeviceAttributesEdgeStateTests.swift */; }; + DA0A02080000000000000000 /* DeviceAttributesHitProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01080000000000000000 /* DeviceAttributesHitProcessorTests.swift */; }; + DA0A02090000000000000000 /* DeviceAttributesRequestBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A01090000000000000000 /* DeviceAttributesRequestBuilderTests.swift */; }; + DA0A020A0000000000000000 /* DeviceAttributesNetworkResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA0A010A0000000000000000 /* DeviceAttributesNetworkResult.swift */; }; + E1D6B4700000000000000102 /* EdgeBatchingConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D6B4700000000000000101 /* EdgeBatchingConfig.swift */; }; + E1D6B4700000000000000202 /* EdgeBatchingConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D6B4700000000000000201 /* EdgeBatchingConfigTests.swift */; }; E97FFA8059E1B17324D8FFC6 /* Pods_AEPEdge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2E916ED29158164BF50EBF1 /* Pods_AEPEdge.framework */; }; F14D1687F07BBBB83A0A2C8E /* Pods_TestAppiOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 316EF062B0B622235F6BB384 /* Pods_TestAppiOS.framework */; }; F523011B38819380501BF58A /* BatchOutcome.swift in Sources */ = {isa = PBXBuildFile; fileRef = D92F05877927388600B8DA62 /* BatchOutcome.swift */; }; @@ -231,16 +231,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - DA0A01000000000000000000 /* DeviceAttributesConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesConstants.swift; sourceTree = ""; }; - DA0A01010000000000000000 /* Event+DeviceAttributes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Event+DeviceAttributes.swift"; sourceTree = ""; }; - DA0A01020000000000000000 /* DeviceAttributesRequestBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesRequestBuilder.swift; sourceTree = ""; }; - DA0A01030000000000000000 /* DeviceAttributesNetworkService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesNetworkService.swift; sourceTree = ""; }; - DA0A010A0000000000000000 /* DeviceAttributesNetworkResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesNetworkResult.swift; sourceTree = ""; }; - DA0A01050000000000000000 /* DeviceAttributesHitProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesHitProcessor.swift; sourceTree = ""; }; - DA0A01060000000000000000 /* DeviceAttributesEdgeExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesEdgeExtensionTests.swift; sourceTree = ""; }; - DA0A01070000000000000000 /* DeviceAttributesEdgeStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesEdgeStateTests.swift; sourceTree = ""; }; - DA0A01080000000000000000 /* DeviceAttributesHitProcessorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesHitProcessorTests.swift; sourceTree = ""; }; - DA0A01090000000000000000 /* DeviceAttributesRequestBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesRequestBuilderTests.swift; sourceTree = ""; }; 04A228C42686D67347C85BEA /* Pods-TestAppiOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestAppiOS.release.xcconfig"; path = "Target Support Files/Pods-TestAppiOS/Pods-TestAppiOS.release.xcconfig"; sourceTree = ""; }; 0B13510405D14B13EFD1B58A /* Pods_FunctionalTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FunctionalTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1CCD27C52458CB2300E912B2 /* ExperienceEvent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExperienceEvent.swift; sourceTree = ""; }; @@ -250,9 +240,6 @@ 216989642554B39900B2752C /* EdgeHit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeHit.swift; sourceTree = ""; }; 216989772554B61500B2752C /* EdgeHitProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeHitProcessor.swift; sourceTree = ""; }; 216989B22555376A00B2752C /* EdgeHitProcessorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeHitProcessorTests.swift; sourceTree = ""; }; - E742414B220FB400B4D6FDE5 /* EdgeBundledBatchingConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeBundledBatchingConfigTests.swift; sourceTree = ""; }; - E1D6B4700000000000000201 /* EdgeBatchingConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeBatchingConfigTests.swift; sourceTree = ""; }; - 3F7B22645DB9C48815995C56 /* SharedStateReaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedStateReaderTests.swift; sourceTree = ""; }; 2198DEE12604F8BE008ADB6A /* Atomic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Atomic.swift; sourceTree = ""; }; 2198DEE726050458008ADB6A /* AtomicTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtomicTests.swift; sourceTree = ""; }; 21C0F8892627B9D9003872DC /* EdgeEndpoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeEndpoint.swift; sourceTree = ""; }; @@ -260,15 +247,15 @@ 21FFBD5825631E3E00B48A8F /* EdgeEventWarningTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeEventWarningTests.swift; sourceTree = ""; }; 21FFBD6B2563321600B48A8F /* EdgeResponseErrorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeResponseErrorTests.swift; sourceTree = ""; }; 24D4B4F8439125544300678E /* EdgeBatchingHitQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EdgeBatchingHitQueue.swift; sourceTree = ""; }; - E1D6B4700000000000000101 /* EdgeBatchingConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EdgeBatchingConfig.swift; sourceTree = ""; }; - 314D898C6438199FBCA790A7 /* EdgeBundledBatchingConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EdgeBundledBatchingConfig.swift; sourceTree = ""; }; 2E1810022ACCB83F0067E444 /* ConfigOverrideTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigOverrideTests.swift; sourceTree = ""; }; 2E1810042ACCBA1B0067E444 /* TestEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestEnvironment.swift; sourceTree = ""; }; 2E1810062ACCE5B00067E444 /* TestBase+EdgeHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TestBase+EdgeHelpers.swift"; sourceTree = ""; }; 2EC056ED2AB4F57100023BDE /* SDKConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDKConfig.swift; sourceTree = ""; }; 2ECFB7512AB391F400653128 /* EdgeDatastreamConfigOverrideTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeDatastreamConfigOverrideTests.swift; sourceTree = ""; }; 2EDD05D2286EAA7000229CB2 /* TestApptvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestApptvOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 314D898C6438199FBCA790A7 /* EdgeBundledBatchingConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EdgeBundledBatchingConfig.swift; sourceTree = ""; }; 316EF062B0B622235F6BB384 /* Pods_TestAppiOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestAppiOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F7B22645DB9C48815995C56 /* SharedStateReaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedStateReaderTests.swift; sourceTree = ""; }; 4C089BC42CF01AA900CB500C /* FunctionalTestConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FunctionalTestConstants.swift; sourceTree = ""; }; 4CBEE5E029D637170084BC50 /* UpstreamIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UpstreamIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 4CBEE5E229D637E90084BC50 /* UpstreamIntegrationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpstreamIntegrationTests.swift; sourceTree = ""; }; @@ -284,6 +271,7 @@ 5D0A46E5E96B2F3FFF4F9B26 /* EdgeDataEntityTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EdgeDataEntityTests.swift; sourceTree = ""; }; 5DA0155731FA82D43DA47B93 /* Pods_UnitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UnitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5E8ABC044CA69B7B3B6DA2B8 /* Pods-UpstreamIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UpstreamIntegrationTests.debug.xcconfig"; path = "Target Support Files/Pods-UpstreamIntegrationTests/Pods-UpstreamIntegrationTests.debug.xcconfig"; sourceTree = ""; }; + 68EF62435DADA4A4D8860D52 /* EdgeEventError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeEventError.swift; sourceTree = ""; }; 7276A55D4B28344E8ED9D27B /* Pods-TestAppiOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestAppiOS.debug.xcconfig"; path = "Target Support Files/Pods-TestAppiOS/Pods-TestAppiOS.debug.xcconfig"; sourceTree = ""; }; 773BC882A27A812B96D9C711 /* Pods_UpstreamIntegrationTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UpstreamIntegrationTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7D2276E22F20223193235527 /* Pods-AEPEdge.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AEPEdge.release.xcconfig"; path = "Target Support Files/Pods-AEPEdge/Pods-AEPEdge.release.xcconfig"; sourceTree = ""; }; @@ -347,8 +335,6 @@ D45F2E8125EE1987000AC350 /* EdgePublicAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgePublicAPITests.swift; sourceTree = ""; }; D46553F6246A384900A150E2 /* NetworkResponseHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkResponseHandlerTests.swift; sourceTree = ""; }; D46553F8246B43B900A150E2 /* EdgeEventHandle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeEventHandle.swift; sourceTree = ""; }; - 68EF62435DADA4A4D8860D52 /* EdgeEventError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeEventError.swift; sourceTree = ""; }; - EE3157E3F5ECD3431FDBB351 /* EdgeCallbackWithError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeCallbackWithError.swift; sourceTree = ""; }; D46553FA246B6FBC00A150E2 /* EdgeResponseError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeResponseError.swift; sourceTree = ""; }; D48CBD2124A17EEA00A24BD8 /* TestXDMSchema.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestXDMSchema.swift; sourceTree = ""; }; D4967534251130D3001F5F95 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -385,7 +371,21 @@ D4F74FE82447A92800379258 /* MockURLSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockURLSession.swift; sourceTree = ""; }; D4F74FEA2447A94900379258 /* MockTask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockTask.swift; sourceTree = ""; }; D92F05877927388600B8DA62 /* BatchOutcome.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BatchOutcome.swift; sourceTree = ""; }; + DA0A01000000000000000000 /* DeviceAttributesConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesConstants.swift; sourceTree = ""; }; + DA0A01010000000000000000 /* Event+DeviceAttributes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Event+DeviceAttributes.swift"; sourceTree = ""; }; + DA0A01020000000000000000 /* DeviceAttributesRequestBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesRequestBuilder.swift; sourceTree = ""; }; + DA0A01030000000000000000 /* DeviceAttributesNetworkService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesNetworkService.swift; sourceTree = ""; }; + DA0A01050000000000000000 /* DeviceAttributesHitProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesHitProcessor.swift; sourceTree = ""; }; + DA0A01060000000000000000 /* DeviceAttributesEdgeExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesEdgeExtensionTests.swift; sourceTree = ""; }; + DA0A01070000000000000000 /* DeviceAttributesEdgeStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesEdgeStateTests.swift; sourceTree = ""; }; + DA0A01080000000000000000 /* DeviceAttributesHitProcessorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesHitProcessorTests.swift; sourceTree = ""; }; + DA0A01090000000000000000 /* DeviceAttributesRequestBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesRequestBuilderTests.swift; sourceTree = ""; }; + DA0A010A0000000000000000 /* DeviceAttributesNetworkResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAttributesNetworkResult.swift; sourceTree = ""; }; + E1D6B4700000000000000101 /* EdgeBatchingConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EdgeBatchingConfig.swift; sourceTree = ""; }; + E1D6B4700000000000000201 /* EdgeBatchingConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeBatchingConfigTests.swift; sourceTree = ""; }; + E742414B220FB400B4D6FDE5 /* EdgeBundledBatchingConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeBundledBatchingConfigTests.swift; sourceTree = ""; }; ECE21024865660B5DB78AD82 /* Pods-E2EFunctionalTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-E2EFunctionalTests.release.xcconfig"; path = "Target Support Files/Pods-E2EFunctionalTests/Pods-E2EFunctionalTests.release.xcconfig"; sourceTree = ""; }; + EE3157E3F5ECD3431FDBB351 /* EdgeCallbackWithError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeCallbackWithError.swift; sourceTree = ""; }; F6293FCD59AB7997E527BB5A /* Pods_E2EFunctionalTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_E2EFunctionalTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F85212C814AA412355526B9F /* Pods_TestApptvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestApptvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FBFE2267C0A1FD6FB1B3B76D /* Pods-FunctionalTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FunctionalTests.debug.xcconfig"; path = "Target Support Files/Pods-FunctionalTests/Pods-FunctionalTests.debug.xcconfig"; sourceTree = ""; }; @@ -449,19 +449,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - DA0A03000000000000000000 /* DeviceAttributes */ = { - isa = PBXGroup; - children = ( - DA0A01000000000000000000 /* DeviceAttributesConstants.swift */, - DA0A01010000000000000000 /* Event+DeviceAttributes.swift */, - DA0A01020000000000000000 /* DeviceAttributesRequestBuilder.swift */, - DA0A01030000000000000000 /* DeviceAttributesNetworkService.swift */, - DA0A010A0000000000000000 /* DeviceAttributesNetworkResult.swift */, - DA0A01050000000000000000 /* DeviceAttributesHitProcessor.swift */, - ); - path = DeviceAttributes; - sourceTree = ""; - }; 1CCD27CD24592B2800E912B2 /* xdm */ = { isa = PBXGroup; children = ( @@ -732,6 +719,19 @@ name = utils; sourceTree = ""; }; + DA0A03000000000000000000 /* DeviceAttributes */ = { + isa = PBXGroup; + children = ( + DA0A01000000000000000000 /* DeviceAttributesConstants.swift */, + DA0A01010000000000000000 /* Event+DeviceAttributes.swift */, + DA0A01020000000000000000 /* DeviceAttributesRequestBuilder.swift */, + DA0A01030000000000000000 /* DeviceAttributesNetworkService.swift */, + DA0A010A0000000000000000 /* DeviceAttributesNetworkResult.swift */, + DA0A01050000000000000000 /* DeviceAttributesHitProcessor.swift */, + ); + path = DeviceAttributes; + sourceTree = ""; + }; E5239B915F53B993A1976FC4 /* Pods */ = { isa = PBXGroup; children = ( @@ -1515,7 +1515,7 @@ ENABLE_PREVIEWS = YES; GCC_NO_COMMON_BLOCKS = NO; INFOPLIST_FILE = TestApps/TestAppSwiftUI/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1527,7 +1527,7 @@ SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 13.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -1544,7 +1544,7 @@ ENABLE_PREVIEWS = YES; GCC_NO_COMMON_BLOCKS = NO; INFOPLIST_FILE = TestApps/TestAppSwiftUI/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1556,7 +1556,7 @@ SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 13.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; @@ -1571,7 +1571,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = FKGEE875K4; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1586,7 +1586,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -1601,7 +1601,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = FKGEE875K4; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1615,7 +1615,7 @@ SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; @@ -1636,7 +1636,7 @@ HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1648,9 +1648,9 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = "$(AEPEDGE_SWIFT_VERSION:default=5.0)"; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1672,7 +1672,7 @@ HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1684,9 +1684,9 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = "$(AEPEDGE_SWIFT_VERSION:default=5.0)"; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1699,8 +1699,9 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = FKGEE875K4; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; PRODUCT_NAME = "$(TARGET_NAME)"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -1712,8 +1713,9 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = FKGEE875K4; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; PRODUCT_NAME = "$(TARGET_NAME)"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; @@ -1769,14 +1771,14 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -1825,13 +1827,13 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -1843,7 +1845,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = FKGEE875K4; INFOPLIST_FILE = Tests/UnitTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1854,7 +1856,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -1865,7 +1867,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = FKGEE875K4; INFOPLIST_FILE = Tests/UnitTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1876,7 +1878,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; @@ -1887,7 +1889,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = FKGEE875K4; INFOPLIST_FILE = Tests/FunctionalTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1898,7 +1900,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -1909,7 +1911,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = FKGEE875K4; INFOPLIST_FILE = Tests/FunctionalTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1920,7 +1922,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 12.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; @@ -1937,7 +1939,7 @@ ENABLE_PREVIEWS = YES; GCC_NO_COMMON_BLOCKS = NO; INFOPLIST_FILE = TestApps/TestAppSwiftUI/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1951,7 +1953,7 @@ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 13.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -1968,7 +1970,7 @@ ENABLE_PREVIEWS = YES; GCC_NO_COMMON_BLOCKS = NO; INFOPLIST_FILE = TestApps/TestAppSwiftUI/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1982,7 +1984,7 @@ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 13.0; + TVOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; diff --git a/Makefile b/Makefile index c319b7c5..65a61cbe 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ TVOS_ARCHIVE_PATH = $(CURR_DIR)/build/tvos.xcarchive/Products/Library/Frameworks TVOS_ARCHIVE_DSYM_PATH = $(CURR_DIR)/build/tvos.xcarchive/dSYMs/ # CI variables - using values with defaults. Set defaults to values that are most useful for local development. -IOS_DEVICE_NAME ?= iPhone 15 +IOS_DEVICE_NAME ?= iPhone 18 Pro # If OS version is not specified, uses the first device name match in the list of available simulators IOS_VERSION ?= ifeq ($(strip $(IOS_VERSION)),) @@ -24,7 +24,7 @@ else IOS_DESTINATION = "platform=iOS Simulator,name=$(IOS_DEVICE_NAME),OS=$(IOS_VERSION)" endif -TVOS_DEVICE_NAME ?= Apple TV +TVOS_DEVICE_NAME ?= Apple TV 4K (3rd generation) # If OS version is not specified, uses the first device name match in the list of available simulators TVOS_VERSION ?= ifeq ($(strip $(TVOS_VERSION)),) @@ -173,5 +173,25 @@ lint: test-SPM-integration: sh ./Script/test-SPM.sh +# Builds the AEPEdge target in Swift 6 language mode. AEPEDGE_SWIFT_VERSION is +# only referenced by the AEPEdge target, so dependency pods keep their own modes. +build-swift6: + xcodebuild build -workspace $(PROJECT_NAME).xcworkspace -scheme $(PROJECT_NAME) -destination 'generic/platform=iOS Simulator' AEPEDGE_SWIFT_VERSION=6.0 ADB_SKIP_LINT=YES + xcodebuild build -workspace $(PROJECT_NAME).xcworkspace -scheme $(PROJECT_NAME) -destination 'generic/platform=tvOS Simulator' AEPEDGE_SWIFT_VERSION=6.0 ADB_SKIP_LINT=YES + +# Compiles a Swift 6 consumer that calls the public completion-handler APIs with +# plain closures from @MainActor code (protects the @Sendable contract). The +# consumer target is built in Swift 6 language mode; AEPEdge and its dependencies +# keep their own declared language modes, matching a real Swift 6 app's build. + +test-swift6-consumer: + sh ./Script/test-swift6-consumer.sh + +# Compile-only build on the minimum supported toolchain (Xcode 15.3+/Swift 5.10). +build-min-toolchain: + xcodebuild build -workspace $(PROJECT_NAME).xcworkspace -scheme $(PROJECT_NAME) -destination 'generic/platform=iOS Simulator' ADB_SKIP_LINT=YES + xcodebuild build -workspace $(PROJECT_NAME).xcworkspace -scheme $(PROJECT_NAME) -destination 'generic/platform=tvOS Simulator' ADB_SKIP_LINT=YES + + test-podspec: sh ./Script/test-podspec.sh \ No newline at end of file diff --git a/Package.swift b/Package.swift index 1c8480ee..6a55ca81 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version:5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. /* Copyright 2020 Adobe. All rights reserved. @@ -15,7 +15,7 @@ import PackageDescription let package = Package( name: "AEPEdge", - platforms: [.iOS(.v12), .tvOS(.v12)], + platforms: [.iOS(.v15), .tvOS(.v15)], products: [ .library(name: "AEPEdge", targets: ["AEPEdge"]) ], diff --git a/Podfile b/Podfile index ae09c9bb..e22082e4 100644 --- a/Podfile +++ b/Podfile @@ -1,5 +1,5 @@ # Uncomment the next line to define a global platform for your project -platform :ios, '12.0' +platform :ios, '15.0' # Comment the next line if you don't want to use dynamic frameworks use_frameworks! @@ -54,7 +54,8 @@ end post_install do |pi| pi.pods_project.targets.each do |t| t.build_configurations.each do |bc| - bc.build_settings['TVOS_DEPLOYMENT_TARGET'] = '12.0' + bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0' + bc.build_settings['TVOS_DEPLOYMENT_TARGET'] = '15.0' bc.build_settings['SUPPORTED_PLATFORMS'] = 'iphoneos iphonesimulator appletvos appletvsimulator' bc.build_settings['TARGETED_DEVICE_FAMILY'] = "1,2,3" end diff --git a/Podfile.lock b/Podfile.lock index 4dcfe221..275aa397 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -54,7 +54,7 @@ CHECKOUT OPTIONS: SPEC CHECKSUMS: AEPAssurance: 3ab00d47a40bc6c6cb2000689e0dcfa595cda250 AEPCore: 13541c6cd72488506a3fda85a5e1288759f09336 - AEPEdge: bf1044fefb7038ef98dff4834154145967a35cf9 + AEPEdge: 2243ebfbd3f7bd88464a8caddd626634c642a292 AEPEdgeConsent: b5a54985b79ee0222b1f1fc4b0859f8b8afed07a AEPEdgeIdentity: 784ecc1dd434f9a19c66cc74a6a947876b93fa8f AEPRulesEngine: fe5800653a4bee07b1e41e61b4d5551f0dba557b @@ -62,6 +62,6 @@ SPEC CHECKSUMS: AEPTestUtils: 2bbed995c8974f6f6d92058db88d6cd2e4a7f869 SwiftLint: 13280e21cdda6786ad908dc6e416afe5acd1fcb7 -PODFILE CHECKSUM: 92bb69895448b79aa523a99f61cda67f43890e00 +PODFILE CHECKSUM: 36aa15c92787a4e5ae2af17173c30bab00d9c2c5 -COCOAPODS: 1.16.2 +COCOAPODS: 1.17.0 diff --git a/README.md b/README.md index 5789aa2c..3fcf5103 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ The Edge Network mobile extension is part of the [Adobe Experience Platform Mobi For more details, see the [Adobe Experience Platform Edge Network](https://developer.adobe.com/client-sdks/documentation/edge-network/) documentation. ## Requirements -- Xcode 15 (or newer) -- Swift 5.1 (or newer) +- Xcode 15.3 (or newer) +- Swift 5.10 (or newer) ## Installation diff --git a/Script/test-SPM.sh b/Script/test-SPM.sh index d2cfbc28..0877703f 100755 --- a/Script/test-SPM.sh +++ b/Script/test-SPM.sh @@ -13,14 +13,14 @@ mkdir -p $PROJECT_NAME && cd $PROJECT_NAME swift package init # Create the Package.swift. -echo "// swift-tools-version:5.3 +echo "// swift-tools-version:5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: \"TestProject\", defaultLocalization: \"en-US\", platforms: [ - .iOS(.v12), .tvOS(.v12) + .iOS(.v15), .tvOS(.v15) ], products: [ .library( diff --git a/Script/test-podspec.sh b/Script/test-podspec.sh index 7eaef51a..7ed02632 100644 --- a/Script/test-podspec.sh +++ b/Script/test-podspec.sh @@ -22,7 +22,7 @@ targets: type: framework sources: Sources platform: iOS - deploymentTarget: "12.0" + deploymentTarget: "15.0" settings: GENERATE_INFOPLIST_FILE: YES " >>project.yml @@ -82,7 +82,7 @@ targets: type: framework sources: Sources platform: tvOS - deploymentTarget: "12.0" + deploymentTarget: "15.0" settings: GENERATE_INFOPLIST_FILE: YES " >>project.yml diff --git a/Script/test-swift6-consumer.sh b/Script/test-swift6-consumer.sh new file mode 100755 index 00000000..c36cbae1 --- /dev/null +++ b/Script/test-swift6-consumer.sh @@ -0,0 +1,116 @@ +#!/bin/bash + +set -e # Any subsequent(*) commands which fail will cause the shell script to exit immediately + +# Builds a minimal Swift 6 consumer of AEPEdge to continuously protect the +# @Sendable / @preconcurrency public completion-handler contract. +# +# The consumer calls Edge.sendEvent and Edge.getLocationHint with *plain* +# closures from @MainActor code. Because the public completions are declared +# @Sendable, the compiler must accept these calls from a main-actor context +# without inferring main-actor isolation on the closure (the inference that +# causes the libdispatch "expected on main queue" crash at runtime). If the +# @Sendable annotation were dropped, this Swift 6 build would fail. + +PROJECT_NAME=Swift6Consumer + +# Clean up. +rm -rf $PROJECT_NAME + +mkdir -p $PROJECT_NAME && cd $PROJECT_NAME + +# Create the package. +swift package init + +# Create the Package.swift. The consumer target is compiled in Swift 6 language +# mode; dependencies keep their own declared language modes. +echo "// swift-tools-version:6.0 +// The swift-tools-version declares the minimum version of Swift required to build this package. +import PackageDescription +let package = Package( + name: \"Swift6Consumer\", + defaultLocalization: \"en-US\", + platforms: [ + .iOS(.v15), .tvOS(.v15) + ], + products: [ + .library( + name: \"Swift6Consumer\", + targets: [\"Swift6Consumer\"] + ) + ], + dependencies: [ + .package(name: \"AEPCore\", url: \"https://github.com/adobe/aepsdk-core-ios.git\", .branch(\"main\")), + .package(name: \"AEPEdge\", path: \"../\") + ], + targets: [ + .target( + name: \"Swift6Consumer\", + dependencies: [ + .product(name: \"AEPCore\", package: \"AEPCore\"), + .product(name: \"AEPServices\", package: \"AEPCore\"), + .product(name: \"AEPEdge\", package: \"AEPEdge\"), + ], + swiftSettings: [ + .swiftLanguageMode(.v6) + ]) + ] +) +" >Package.swift + +# Replace the generated source with a @MainActor consumer that exercises the +# public completion-handler APIs with plain (non-@Sendable-annotated) closures. +rm -rf Sources/Swift6Consumer +mkdir -p Sources/Swift6Consumer +echo "import AEPEdge +import AEPServices +import Foundation + +@MainActor +final class Swift6Consumer { + var lastHandleCount = 0 + var lastHint: String? + var lastError: Error? + + func exercise() { + let event = ExperienceEvent(xdm: [\"test\": \"xdm\"]) + + // Plain closure from @MainActor code: compiles only because the public + // completion is @Sendable (success path). Extract a Sendable value, then + // hand UI work to the main actor. + Edge.sendEvent(experienceEvent: event) { handles in + let count = handles.count + Task { @MainActor in + self.lastHandleCount = count + } + } + + // Plain closure from @MainActor code: success + error/timeout paths. + Edge.getLocationHint { hint, error in + Task { @MainActor in + self.lastHint = hint + self.lastError = error + } + } + } +} +" >Sources/Swift6Consumer/Swift6Consumer.swift + +swift package update +swift package resolve + +# This is necessary to avoid internal PIF error +swift package dump-pif > /dev/null +(xcodebuild clean -scheme Swift6Consumer -destination 'generic/platform=iOS' > /dev/null) || : + +# Build for generic iOS device in Swift 6 language mode +echo '############# Build Swift 6 consumer for generic iOS device ###############' +xcodebuild build -scheme Swift6Consumer -destination 'generic/platform=iOS' + +# Build for generic tvOS device in Swift 6 language mode +echo '############# Build Swift 6 consumer for generic tvOS device ###############' +xcodebuild build -scheme Swift6Consumer -destination 'generic/platform=tvOS' + +# Clean up. +cd ../ +rm -rf $PROJECT_NAME diff --git a/Sources/Edge+PublicAPI.swift b/Sources/Edge+PublicAPI.swift index 2bfe262e..9b3c9bfd 100644 --- a/Sources/Edge+PublicAPI.swift +++ b/Sources/Edge+PublicAPI.swift @@ -24,7 +24,7 @@ public extension Edge { /// - completion: Optional completion handler to be invoked when the request is complete, returning the associated response handles /// received from the Adobe Experience Edge. It may be invoked on a different thread. @objc(sendExperienceEvent:completion:) - static func sendEvent(experienceEvent: ExperienceEvent, _ completion: (([EdgeEventHandle]) -> Void)? = nil) { + @preconcurrency static func sendEvent(experienceEvent: ExperienceEvent, _ completion: (@Sendable ([EdgeEventHandle]) -> Void)? = nil) { guard let xdmData = experienceEvent.xdm, !xdmData.isEmpty, let eventData = experienceEvent.asDictionary() else { Log.debug(label: LOG_TAG, "Failed to dispatch the experience event because the XDM data was nil/empty.") return @@ -68,7 +68,7 @@ public extension Edge { /// Returns the Edge Network location hint, or nil if the location hint expired or is not set. /// - Parameter completion: A completion handler invoked with the location hint, or an 'AEPError' if the request times out or an unexpected error occurs. @objc(getLocationHint:) - static func getLocationHint(_ completion: @escaping (String?, Error?) -> Void) { + @preconcurrency static func getLocationHint(_ completion: @escaping @Sendable (String?, Error?) -> Void) { let event = Event(name: "Edge Request Location Hint", type: EventType.edge, source: EventSource.requestIdentity, diff --git a/Sources/EdgeNetworkHandlers/CompletionHandlersManager.swift b/Sources/EdgeNetworkHandlers/CompletionHandlersManager.swift index aa34b195..de290120 100644 --- a/Sources/EdgeNetworkHandlers/CompletionHandlersManager.swift +++ b/Sources/EdgeNetworkHandlers/CompletionHandlersManager.swift @@ -16,7 +16,7 @@ import Foundation class CompletionHandlersManager { private let TAG = "CompletionHandlersManager" private var completionHandlers = - ThreadSafeDictionary Void)>(identifier: "com.adobe.edge.completionHandlers") + ThreadSafeDictionary Void)>(identifier: "com.adobe.edge.completionHandlers") // edge response handles for a event request id (key) private var edgeEventHandles = @@ -30,7 +30,7 @@ class CompletionHandlersManager { private var edgeEventErrors = ThreadSafeDictionary(identifier: "com.adobe.edge.edgeEventErrorsList") - static let shared = CompletionHandlersManager() + nonisolated(unsafe) static let shared = CompletionHandlersManager() /// Registers a completion handler for the specified `requestEventId`. This handler is invoked when the Edge response content has been /// handled entirely by the Edge extension, containing a list of `EdgeEventHandle`(s). This list can be empty or can contain one or multiple items @@ -39,7 +39,7 @@ class CompletionHandlersManager { /// - Parameters: /// - forRequestEventId: unique event identifier for which the completion handler is registered; should not be empty /// - completionHandler: the completion handler that needs to be registered, should not be nil - func registerCompletionHandler(forRequestEventId: String, completion: (([EdgeEventHandle]) -> Void)?) { + func registerCompletionHandler(forRequestEventId: String, completion: (@Sendable ([EdgeEventHandle]) -> Void)?) { guard let unwrappedCompletion = completion else { return } guard !forRequestEventId.isEmpty else { Log.warning(label: TAG, "Failed to register completion handler because of empty request event id.") diff --git a/Sources/EdgeNetworkHandlers/EdgeBundledBatchingConfig.swift b/Sources/EdgeNetworkHandlers/EdgeBundledBatchingConfig.swift index c8a42ac1..e26d9c2d 100644 --- a/Sources/EdgeNetworkHandlers/EdgeBundledBatchingConfig.swift +++ b/Sources/EdgeNetworkHandlers/EdgeBundledBatchingConfig.swift @@ -31,8 +31,8 @@ enum EdgeBundledBatchingConfig { static let BUNDLED_CONFIG_FILE_TYPE = "json" private static let loadLock = NSLock() - private static var cachedConfig: [String: Any]? - private static var loadAttempted = false + nonisolated(unsafe) private static var cachedConfig: [String: Any]? + nonisolated(unsafe) private static var loadAttempted = false /// Returns the parsed contents of the bundled batching config file, loading and caching it the /// first time this is called. Subsequent calls return the cached result without re-reading the diff --git a/Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift b/Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift index fab88187..f35386e1 100644 --- a/Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift +++ b/Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift @@ -30,7 +30,7 @@ class NetworkResponseHandler { /// for the whole batch's stream to close. The highest index and anything still pending complete /// at stream close (`processResponseOnComplete`), exactly as before. Only relevant to multi-event /// batched responses; single events, consent, batch-of-1 are unaffected either way. - static var earlyPerEventCompletionEnabled = true + nonisolated(unsafe) static var earlyPerEventCompletionEnabled = true // the order of the request events matter for matching them with the response events private var sentEventsWaitingResponse = ThreadSafeDictionary() diff --git a/TestApps/TestAppSwiftUI/AppDelegate.swift b/TestApps/TestAppSwiftUI/AppDelegate.swift index 4adecd33..3060a6aa 100644 --- a/TestApps/TestAppSwiftUI/AppDelegate.swift +++ b/TestApps/TestAppSwiftUI/AppDelegate.swift @@ -21,7 +21,7 @@ import UIKit import AEPAssurance #endif -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { // TODO: Set up the Environment File ID from your Launch property for the preferred environment private let LAUNCH_ENVIRONMENT_FILE_ID = "" diff --git a/TestApps/TestAppSwiftUI/ContentView.swift b/TestApps/TestAppSwiftUI/ContentView.swift index c89f382e..37ffbd8c 100644 --- a/TestApps/TestAppSwiftUI/ContentView.swift +++ b/TestApps/TestAppSwiftUI/ContentView.swift @@ -98,24 +98,31 @@ struct ContentView: View { let experienceEvent = ExperienceEvent(xdm: ["xdmtest": "data"], data: ["data": ["test": "data"]]) Edge.sendEvent(experienceEvent: experienceEvent, { (handles: [EdgeEventHandle]) in + // Encode on the callback queue; only the String crosses to the main queue. let encoder = JSONEncoder() encoder.outputFormatting = .prettyPrinted - guard let data = try? encoder.encode(handles) else { - self.dataContent = "failed to encode EdgeEventHandle" - return + let text: String + if let data = try? encoder.encode(handles) { + text = String(data: data, encoding: .utf8) ?? "failed to encode JSON to string" + } else { + text = "failed to encode EdgeEventHandle" + } + DispatchQueue.main.async { + self.dataContent = text } - self.dataContent = String(data: data, encoding: .utf8) ?? "failed to encode JSON to string" }) }).padding() HStack { Button("Get Location Hint", action: { Edge.getLocationHint({ hint, error in - if error != nil { - dataContent = "Received error '\((error as? AEPError)?.localizedDescription ?? "nil")" - } else { - dataContent = "Location hint: '\(hint ?? "nil")'" - selectedRegion = RegionId(rawValue: hint ?? "nil") ?? .nil_value + DispatchQueue.main.async { + if error != nil { + dataContent = "Received error '\((error as? AEPError)?.localizedDescription ?? "nil")" + } else { + dataContent = "Location hint: '\(hint ?? "nil")'" + selectedRegion = RegionId(rawValue: hint ?? "nil") ?? .nil_value + } } }) }).padding() @@ -143,8 +150,9 @@ struct ContentView: View { return } + let text = "Completion Event received: \(String(describing: responseEvent.data))" DispatchQueue.main.async { - self.dataContent = "Completion Event received: \(String(describing: responseEvent.data))" + self.dataContent = text } } }).padding() @@ -252,12 +260,14 @@ struct ContentView: View { private func getECID() { Identity.getExperienceCloudId { value, error in - if error != nil { - self.ecid = "" - return - } + DispatchQueue.main.async { + if error != nil { + self.ecid = "" + return + } - self.ecid = value ?? "" + self.ecid = value ?? "" + } } } @@ -278,16 +288,20 @@ struct ContentView: View { private func getIdentities() { Identity.getIdentities { identityMap, _ in + let text: String if let identityMap = identityMap { let encoder = JSONEncoder() encoder.outputFormatting = .prettyPrinted - guard let data = try? encoder.encode(identityMap) else { - self.dataContent = "failed to encode IdentityMap" - return + if let data = try? encoder.encode(identityMap) { + text = String(data: data, encoding: .utf8) ?? "failed to encode JSON to string" + } else { + text = "failed to encode IdentityMap" } - self.dataContent = String(data: data, encoding: .utf8) ?? "failed to encode JSON to string" } else { - self.dataContent = "IdentityMap was nil" + text = "IdentityMap was nil" + } + DispatchQueue.main.async { + self.dataContent = text } } } @@ -297,7 +311,9 @@ struct ContentView: View { guard error == nil, let consents = consents else { return } guard let jsonData = try? JSONSerialization.data(withJSONObject: consents, options: .prettyPrinted) else { return } guard let jsonStr = String(data: jsonData, encoding: .utf8) else { return } - self.dataContent = jsonStr + DispatchQueue.main.async { + self.dataContent = jsonStr + } } } diff --git a/Tests/FunctionalTests/util/FakeIdentityExtension.swift b/Tests/FunctionalTests/util/FakeIdentityExtension.swift index 9b1be385..1d8667e9 100644 --- a/Tests/FunctionalTests/util/FakeIdentityExtension.swift +++ b/Tests/FunctionalTests/util/FakeIdentityExtension.swift @@ -29,7 +29,7 @@ class FakeIdentityExtension: NSObject, Extension { var friendlyName: String = "Identity" - static var extensionVersion: String = "1.0.0" + nonisolated(unsafe) static var extensionVersion: String = "1.0.0" var metadata: [String: String]? diff --git a/Tests/FunctionalTests/util/TestableEdge.swift b/Tests/FunctionalTests/util/TestableEdge.swift index d8d8b228..e37b791d 100644 --- a/Tests/FunctionalTests/util/TestableEdge.swift +++ b/Tests/FunctionalTests/util/TestableEdge.swift @@ -16,8 +16,8 @@ import XCTest /// Spy class used for testing and inspecting `Edge`. class TestableEdge: Edge { - static public var readyForEventExpectation: XCTestExpectation? - static public var handleExperienceEventRequestExpectation: XCTestExpectation? + static nonisolated(unsafe) public var readyForEventExpectation: XCTestExpectation? + static nonisolated(unsafe) public var handleExperienceEventRequestExpectation: XCTestExpectation? override func handleExperienceEventRequest(_ event: Event) { if let expectation = TestableEdge.handleExperienceEventRequestExpectation { diff --git a/Tests/UnitTests/NetworkResponseHandlerTests.swift b/Tests/UnitTests/NetworkResponseHandlerTests.swift index 742dcf82..2f34da1b 100644 --- a/Tests/UnitTests/NetworkResponseHandlerTests.swift +++ b/Tests/UnitTests/NetworkResponseHandlerTests.swift @@ -113,6 +113,7 @@ class NetworkResponseHandlerTests: XCTestCase { } } + @MainActor func testAddRemoveWaitingEvents_noConcurrencyCrash_whenCalledFromDifferentThreads() { let requestId = "test" let dispatchQueue1 = DispatchQueue(label: "test.queue1", attributes: .concurrent) @@ -121,22 +122,20 @@ class NetworkResponseHandlerTests: XCTestCase { expectation.expectedFulfillmentCount = 100 expectation.assertForOverFulfill = true + nonisolated(unsafe) let handler = networkResponseHandler + let event1 = self.event1 + let event2 = self.event2 + for _ in 1...100 { let rand = Int.random(in: 1..<100) if rand % 2 == 0 { - dispatchQueue1.async { [weak self] in - guard let self = self else { - return - } - XCTAssertNoThrow(self.networkResponseHandler.addWaitingEvents(requestId: requestId, batchedEvents: [self.event1, self.event2])) + dispatchQueue1.async { + XCTAssertNoThrow(handler.addWaitingEvents(requestId: requestId, batchedEvents: [event1, event2])) expectation.fulfill() } } else { - dispatchQueue2.async { [weak self] in - guard let self = self else { - return - } - XCTAssertNoThrow(self.networkResponseHandler.removeWaitingEvents(requestId: requestId)) + dispatchQueue2.async { + XCTAssertNoThrow(handler.removeWaitingEvents(requestId: requestId)) expectation.fulfill() } }