diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 649006d6..f06cf49b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,12 +8,12 @@ on: workflow_dispatch: env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app + DEVELOPER_DIR: /Applications/Xcode_15.4.app jobs: publish-docs: name: Publish Documentation - runs-on: macos-13 + runs-on: macos-14 steps: - uses: actions/checkout@v4 - name: Build docs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ef75b88..b8a4d8c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,12 +10,12 @@ on: workflow_dispatch: env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app + DEVELOPER_DIR: /Applications/Xcode_15.4.app jobs: test: name: Test - runs-on: macos-13 + runs-on: macos-14 strategy: matrix: platform: @@ -33,7 +33,7 @@ jobs: test_examples: name: Test iOS examples - runs-on: macos-13 + runs-on: macos-14 steps: - uses: actions/checkout@v4 - name: Test example iOS @@ -41,7 +41,7 @@ jobs: benchmark: name: Benchmark - runs-on: macos-13 + runs-on: macos-14 steps: - uses: actions/checkout@v4 - name: Run benchmark test @@ -49,7 +49,7 @@ jobs: validation: name: Validation - runs-on: macos-13 + runs-on: macos-14 steps: - uses: actions/checkout@v4 - name: Show environments @@ -69,4 +69,4 @@ jobs: - name: Validate example project run: | make proj - if [ -n "$(git status --porcelain)" ]; then git diff && echo "Make sure that 'Examples/App.xcodeproj' is formated by 'make proj'."; exit 1; fi + if [ -n "$(git status --porcelain)" ]; then git diff && echo "Make sure that Xcode projects are formated by 'make proj'."; exit 1; fi diff --git a/Benchmarks/Test.xcodeproj/project.pbxproj b/Benchmarks/Project.xcodeproj/project.pbxproj similarity index 69% rename from Benchmarks/Test.xcodeproj/project.pbxproj rename to Benchmarks/Project.xcodeproj/project.pbxproj index 798a995e..126be4a8 100644 --- a/Benchmarks/Test.xcodeproj/project.pbxproj +++ b/Benchmarks/Project.xcodeproj/project.pbxproj @@ -7,146 +7,146 @@ objects = { /* Begin PBXBuildFile section */ - 1D2771FDFE40C6CABDDF917E /* Atoms in Frameworks */ = {isa = PBXBuildFile; productRef = 8FA28D81FB67542B978C77EC /* Atoms */; }; - 2D733FEDE81776CDF43B2070 /* TestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8432A315E2B6F14BB15385DB /* TestView.swift */; }; - 4ACF036030220DD27ED6E9AB /* ViewTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A88C19025736B1AC7BC26BB /* ViewTest.swift */; }; - ADEE04D900DF624C273DFE12 /* iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 935AFD08D9C4112C64A67F5E /* iOS.swift */; }; - E345A5D0C2CB73587A580F69 /* BenchmarkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7048E26372FBDB7A4CB3C968 /* BenchmarkTests.swift */; }; + 37CC0A349D1DF8C45DCE3932 /* ViewTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 332DBEA010EA0B6B22BB8B76 /* ViewTest.swift */; }; + 3D04F2994886E9B882272D00 /* Atoms in Frameworks */ = {isa = PBXBuildFile; productRef = 7B5EF8D0C63A771D0273495C /* Atoms */; }; + 6058E8D021BC1704D34B300E /* iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = C19103B92174B65104B95916 /* iOS.swift */; }; + 8A6A36AD830E201403FBC055 /* BenchmarkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C445FFAB770D17223D4108E /* BenchmarkTests.swift */; }; + A0C4F6802223AA2A9A0395E8 /* TestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57ACB744EF58831366B5BCE7 /* TestView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 68557BB4D2681C7B3AAA5DCA /* PBXContainerItemProxy */ = { + DBB168F6872B58577C94E778 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 50812FB55ED5A5F18E24AFCF /* Project object */; + containerPortal = 0FBAE303E3CFC2ABAC876A77 /* Project object */; proxyType = 1; - remoteGlobalIDString = 569DA942B58BCBF95DE856BD; + remoteGlobalIDString = 661ED53A3422F429219FECFF; remoteInfo = TestHostApp; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1DEE159814A41A0971E11A65 /* TestHostApp.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = TestHostApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 624A61E1517E8F886C770B5A /* swiftui-atom-properties */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "swiftui-atom-properties"; path = ..; sourceTree = SOURCE_ROOT; }; - 7048E26372FBDB7A4CB3C968 /* BenchmarkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BenchmarkTests.swift; sourceTree = ""; }; - 8432A315E2B6F14BB15385DB /* TestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestView.swift; sourceTree = ""; }; - 935AFD08D9C4112C64A67F5E /* iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOS.swift; sourceTree = ""; }; - 9A88C19025736B1AC7BC26BB /* ViewTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewTest.swift; sourceTree = ""; }; - F527E0708E450622D6A7C5F0 /* BenchmarkTests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = BenchmarkTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 1B958FC315257DE6087DC271 /* TestHostApp.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = TestHostApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 332DBEA010EA0B6B22BB8B76 /* ViewTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewTest.swift; sourceTree = ""; }; + 3B4D05416F67D739A8D7824C /* swiftui-atom-properties */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "swiftui-atom-properties"; path = ..; sourceTree = SOURCE_ROOT; }; + 57ACB744EF58831366B5BCE7 /* TestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestView.swift; sourceTree = ""; }; + 5C445FFAB770D17223D4108E /* BenchmarkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BenchmarkTests.swift; sourceTree = ""; }; + C19103B92174B65104B95916 /* iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOS.swift; sourceTree = ""; }; + D350017EC00C70F9C6A9EE5F /* BenchmarkTests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = BenchmarkTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 05E31F9F067A5E930171FB99 /* Frameworks */ = { + 091E4B007D3754FEB08A9A62 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1D2771FDFE40C6CABDDF917E /* Atoms in Frameworks */, + 3D04F2994886E9B882272D00 /* Atoms in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0EB3FEA02B94034BD6261AE8 /* Tests */ = { + 1F2DE413CF2CB54988158172 /* App */ = { isa = PBXGroup; children = ( - 7048E26372FBDB7A4CB3C968 /* BenchmarkTests.swift */, - 8432A315E2B6F14BB15385DB /* TestView.swift */, - 9A88C19025736B1AC7BC26BB /* ViewTest.swift */, + C19103B92174B65104B95916 /* iOS.swift */, ); - path = Tests; + path = App; sourceTree = ""; }; - 3D16BC137C898F87A27E5247 /* App */ = { + 293D0FF827366B513839236A = { isa = PBXGroup; children = ( - 935AFD08D9C4112C64A67F5E /* iOS.swift */, + 1F2DE413CF2CB54988158172 /* App */, + A333A3A8D6366A46FB38C5DD /* Packages */, + 2E874F3DDBE69E7EC34999E8 /* Tests */, + AC523591AC7BE9275003D2DB /* Products */, ); - path = App; sourceTree = ""; }; - 5071FF1E3D9776144CA101D1 = { + 2E874F3DDBE69E7EC34999E8 /* Tests */ = { isa = PBXGroup; children = ( - 3D16BC137C898F87A27E5247 /* App */, - 874F3A01C587AF9B35F44BF6 /* Packages */, - 0EB3FEA02B94034BD6261AE8 /* Tests */, - 7A855818340A8D98C10016F9 /* Products */, + 5C445FFAB770D17223D4108E /* BenchmarkTests.swift */, + 57ACB744EF58831366B5BCE7 /* TestView.swift */, + 332DBEA010EA0B6B22BB8B76 /* ViewTest.swift */, ); + path = Tests; sourceTree = ""; }; - 7A855818340A8D98C10016F9 /* Products */ = { + A333A3A8D6366A46FB38C5DD /* Packages */ = { isa = PBXGroup; children = ( - F527E0708E450622D6A7C5F0 /* BenchmarkTests.xctest */, - 1DEE159814A41A0971E11A65 /* TestHostApp.app */, + 3B4D05416F67D739A8D7824C /* swiftui-atom-properties */, ); - name = Products; + name = Packages; sourceTree = ""; }; - 874F3A01C587AF9B35F44BF6 /* Packages */ = { + AC523591AC7BE9275003D2DB /* Products */ = { isa = PBXGroup; children = ( - 624A61E1517E8F886C770B5A /* swiftui-atom-properties */, + D350017EC00C70F9C6A9EE5F /* BenchmarkTests.xctest */, + 1B958FC315257DE6087DC271 /* TestHostApp.app */, ); - name = Packages; + name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 2982F074D7B1E5616AC6E461 /* BenchmarkTests */ = { + 661ED53A3422F429219FECFF /* TestHostApp */ = { isa = PBXNativeTarget; - buildConfigurationList = 5D01D0DD53266D02C6762003 /* Build configuration list for PBXNativeTarget "BenchmarkTests" */; + buildConfigurationList = 26848C6FB078701AE9EEFAC7 /* Build configuration list for PBXNativeTarget "TestHostApp" */; buildPhases = ( - A14DFB8069ADFDF92F917ACE /* Sources */, - 05E31F9F067A5E930171FB99 /* Frameworks */, + B8BC93982F4B8FCB686912D2 /* Sources */, ); buildRules = ( ); dependencies = ( - 15FFF3DA3DE045F03B62E300 /* PBXTargetDependency */, ); - name = BenchmarkTests; - packageProductDependencies = ( - 8FA28D81FB67542B978C77EC /* Atoms */, - ); - productName = BenchmarkTests; - productReference = F527E0708E450622D6A7C5F0 /* BenchmarkTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; + name = TestHostApp; + productName = TestHostApp; + productReference = 1B958FC315257DE6087DC271 /* TestHostApp.app */; + productType = "com.apple.product-type.application"; }; - 569DA942B58BCBF95DE856BD /* TestHostApp */ = { + 6DA7AAFCA871E516913F5B46 /* BenchmarkTests */ = { isa = PBXNativeTarget; - buildConfigurationList = 6C84808BC31176E6C53324B0 /* Build configuration list for PBXNativeTarget "TestHostApp" */; + buildConfigurationList = 9373A9C48A427350E69A3E43 /* Build configuration list for PBXNativeTarget "BenchmarkTests" */; buildPhases = ( - 762EC04CEA11003AE236AA79 /* Sources */, + 23B894EA98DB0447ECB929F0 /* Sources */, + 091E4B007D3754FEB08A9A62 /* Frameworks */, ); buildRules = ( ); dependencies = ( + E59C2F62ECF78BD548283F02 /* PBXTargetDependency */, ); - name = TestHostApp; - productName = TestHostApp; - productReference = 1DEE159814A41A0971E11A65 /* TestHostApp.app */; - productType = "com.apple.product-type.application"; + name = BenchmarkTests; + packageProductDependencies = ( + 7B5EF8D0C63A771D0273495C /* Atoms */, + ); + productName = BenchmarkTests; + productReference = D350017EC00C70F9C6A9EE5F /* BenchmarkTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 50812FB55ED5A5F18E24AFCF /* Project object */ = { + 0FBAE303E3CFC2ABAC876A77 /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; LastUpgradeCheck = 1430; TargetAttributes = { - 2982F074D7B1E5616AC6E461 = { + 661ED53A3422F429219FECFF = { ProvisioningStyle = Manual; }; - 569DA942B58BCBF95DE856BD = { + 6DA7AAFCA871E516913F5B46 = { ProvisioningStyle = Manual; }; }; }; - buildConfigurationList = 55304622378FA4A4BE4DDA43 /* Build configuration list for PBXProject "Test" */; + buildConfigurationList = D91E14E36EC0B415578456F2 /* Build configuration list for PBXProject "Project" */; compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; @@ -154,47 +154,50 @@ Base, en, ); - mainGroup = 5071FF1E3D9776144CA101D1; + mainGroup = 293D0FF827366B513839236A; + packageReferences = ( + 46971BDB6A1F62470AB88C76 /* XCLocalSwiftPackageReference ".." */, + ); projectDirPath = ""; projectRoot = ""; targets = ( - 2982F074D7B1E5616AC6E461 /* BenchmarkTests */, - 569DA942B58BCBF95DE856BD /* TestHostApp */, + 6DA7AAFCA871E516913F5B46 /* BenchmarkTests */, + 661ED53A3422F429219FECFF /* TestHostApp */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 762EC04CEA11003AE236AA79 /* Sources */ = { + 23B894EA98DB0447ECB929F0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - ADEE04D900DF624C273DFE12 /* iOS.swift in Sources */, + 8A6A36AD830E201403FBC055 /* BenchmarkTests.swift in Sources */, + A0C4F6802223AA2A9A0395E8 /* TestView.swift in Sources */, + 37CC0A349D1DF8C45DCE3932 /* ViewTest.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - A14DFB8069ADFDF92F917ACE /* Sources */ = { + B8BC93982F4B8FCB686912D2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E345A5D0C2CB73587A580F69 /* BenchmarkTests.swift in Sources */, - 2D733FEDE81776CDF43B2070 /* TestView.swift in Sources */, - 4ACF036030220DD27ED6E9AB /* ViewTest.swift in Sources */, + 6058E8D021BC1704D34B300E /* iOS.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 15FFF3DA3DE045F03B62E300 /* PBXTargetDependency */ = { + E59C2F62ECF78BD548283F02 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 569DA942B58BCBF95DE856BD /* TestHostApp */; - targetProxy = 68557BB4D2681C7B3AAA5DCA /* PBXContainerItemProxy */; + target = 661ED53A3422F429219FECFF /* TestHostApp */; + targetProxy = DBB168F6872B58577C94E778 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 1B1B2F8F50F6A8B7E9020066 /* Release */ = { + 036FCF7C4B48C154279F289D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -248,11 +251,12 @@ SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_STRICT_CONCURRENCY = complete; SWIFT_VERSION = 5.0; }; name = Release; }; - 35A2ED629AB6EFF69376FAC1 /* Release */ = { + 1D336DAF3461D2B317AF701B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -268,7 +272,7 @@ }; name = Release; }; - 4BF6AD31575A6815BC046530 /* Debug */ = { + 33D7BA5AF0EBD9915189D08B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; @@ -283,9 +287,9 @@ TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestHostApp.app/TestHostApp"; }; - name = Debug; + name = Release; }; - 96C929232A619DB5AF067D4C /* Release */ = { + 3E7ADB5CB4A54B195EADF656 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; @@ -300,9 +304,25 @@ TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestHostApp.app/TestHostApp"; }; - name = Release; + name = Debug; }; - 9C81FA35A406529E15EAF3DF /* Debug */ = { + 90F13894F94F9FABCBC8F7CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "App/Info-iOS.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.TestHostApp"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 999683C4B5329A72D12AD584 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -363,64 +383,56 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_STRICT_CONCURRENCY = complete; SWIFT_VERSION = 5.0; }; name = Debug; }; - D78FA6F9227D37C7709EA1DF /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - INFOPLIST_FILE = "App/Info-iOS.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.TestHostApp"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 55304622378FA4A4BE4DDA43 /* Build configuration list for PBXProject "Test" */ = { + 26848C6FB078701AE9EEFAC7 /* Build configuration list for PBXNativeTarget "TestHostApp" */ = { isa = XCConfigurationList; buildConfigurations = ( - 9C81FA35A406529E15EAF3DF /* Debug */, - 1B1B2F8F50F6A8B7E9020066 /* Release */, + 90F13894F94F9FABCBC8F7CD /* Debug */, + 1D336DAF3461D2B317AF701B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 5D01D0DD53266D02C6762003 /* Build configuration list for PBXNativeTarget "BenchmarkTests" */ = { + 9373A9C48A427350E69A3E43 /* Build configuration list for PBXNativeTarget "BenchmarkTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 4BF6AD31575A6815BC046530 /* Debug */, - 96C929232A619DB5AF067D4C /* Release */, + 3E7ADB5CB4A54B195EADF656 /* Debug */, + 33D7BA5AF0EBD9915189D08B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 6C84808BC31176E6C53324B0 /* Build configuration list for PBXNativeTarget "TestHostApp" */ = { + D91E14E36EC0B415578456F2 /* Build configuration list for PBXProject "Project" */ = { isa = XCConfigurationList; buildConfigurations = ( - D78FA6F9227D37C7709EA1DF /* Debug */, - 35A2ED629AB6EFF69376FAC1 /* Release */, + 999683C4B5329A72D12AD584 /* Debug */, + 036FCF7C4B48C154279F289D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 46971BDB6A1F62470AB88C76 /* XCLocalSwiftPackageReference ".." */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ..; + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCSwiftPackageProductDependency section */ - 8FA28D81FB67542B978C77EC /* Atoms */ = { + 7B5EF8D0C63A771D0273495C /* Atoms */ = { isa = XCSwiftPackageProductDependency; productName = Atoms; }; /* End XCSwiftPackageProductDependency section */ }; - rootObject = 50812FB55ED5A5F18E24AFCF /* Project object */; + rootObject = 0FBAE303E3CFC2ABAC876A77 /* Project object */; } diff --git a/Benchmarks/Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Benchmarks/Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Benchmarks/Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Benchmarks/Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Benchmarks/Test.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Benchmarks/Project.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Benchmarks/Test.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Benchmarks/Project.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Benchmarks/Test.xcodeproj/xcshareddata/xcschemes/BenchmarkTests.xcscheme b/Benchmarks/Project.xcodeproj/xcshareddata/xcschemes/BenchmarkTests.xcscheme similarity index 82% rename from Benchmarks/Test.xcodeproj/xcshareddata/xcschemes/BenchmarkTests.xcscheme rename to Benchmarks/Project.xcodeproj/xcshareddata/xcschemes/BenchmarkTests.xcscheme index 812849b1..0ddcfbd5 100644 --- a/Benchmarks/Test.xcodeproj/xcshareddata/xcschemes/BenchmarkTests.xcscheme +++ b/Benchmarks/Project.xcodeproj/xcshareddata/xcschemes/BenchmarkTests.xcscheme @@ -15,10 +15,10 @@ buildForAnalyzing = "YES"> + ReferencedContainer = "container:Project.xcodeproj"> @@ -32,10 +32,10 @@ + ReferencedContainer = "container:Project.xcodeproj"> @@ -43,10 +43,10 @@ skipped = "NO"> + ReferencedContainer = "container:Project.xcodeproj"> @@ -66,10 +66,10 @@ + ReferencedContainer = "container:Project.xcodeproj"> @@ -82,10 +82,10 @@ + ReferencedContainer = "container:Project.xcodeproj"> diff --git a/Benchmarks/Tests/BenchmarkTests.swift b/Benchmarks/Tests/BenchmarkTests.swift index 478f9f72..3ff6a8fa 100644 --- a/Benchmarks/Tests/BenchmarkTests.swift +++ b/Benchmarks/Tests/BenchmarkTests.swift @@ -14,9 +14,12 @@ final class RenderingPerformanceTests: XCTestCase { test.perform { measure { for _ in 0..<100 { - test.sendTouchSequence([ - (location: CGPoint(x: size.width / 2, y: size.height - 30), globalLocation: nil, timestamp: Date()) - ]) + test.sendTouchSequence( + Array( + repeating: (location: CGPoint(x: size.width / 2, y: size.height - 30), globalLocation: nil, timestamp: Date()), + count: 2 + ) + ) test.turnRunloop(times: 1) } } diff --git a/Benchmarks/Tests/ViewTest.swift b/Benchmarks/Tests/ViewTest.swift index c289ef36..5b65f9e1 100644 --- a/Benchmarks/Tests/ViewTest.swift +++ b/Benchmarks/Tests/ViewTest.swift @@ -1,14 +1,18 @@ import SwiftUI struct ViewTest: _ViewTest { - let rootView: () -> Content + let rootView: @MainActor () -> Content func initRootView() -> some View { - rootView() + MainActor.assumeIsolated { + rootView() + } } func initSize() -> CGSize { - UIScreen.main.bounds.size + MainActor.assumeIsolated { + UIScreen.main.bounds.size + } } func perform(_ body: () -> Void) { diff --git a/Benchmarks/project.yml b/Benchmarks/project.yml index 717333cc..e3b94d05 100644 --- a/Benchmarks/project.yml +++ b/Benchmarks/project.yml @@ -1,4 +1,4 @@ -name: Test +name: Project options: bundleIdPrefix: com.ryo.swiftui-atom-properties.examples @@ -8,6 +8,7 @@ settings: CODE_SIGNING_REQUIRED: NO CODE_SIGN_IDENTITY: "-" CODE_SIGN_STYLE: Manual + SWIFT_STRICT_CONCURRENCY: complete packages: swiftui-atom-properties: diff --git a/Examples/Packages/CrossPlatform/Package.swift b/Examples/Packages/CrossPlatform/Package.swift index fe6977e3..ea892f63 100644 --- a/Examples/Packages/CrossPlatform/Package.swift +++ b/Examples/Packages/CrossPlatform/Package.swift @@ -1,10 +1,9 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 import PackageDescription let swiftSettings: [SwiftSetting] = [ - .unsafeFlags(["-Xfrontend", "-strict-concurrency=complete"]), - .unsafeFlags(["-Xfrontend", "-enable-actor-data-race-checks"]), + .enableExperimentalFeature("StrictConcurrency") ] func target(name: String, dependencies: [Target.Dependency] = []) -> Target { diff --git a/Examples/Packages/iOS/Package.swift b/Examples/Packages/iOS/Package.swift index 25caf3cb..4248a840 100644 --- a/Examples/Packages/iOS/Package.swift +++ b/Examples/Packages/iOS/Package.swift @@ -1,10 +1,9 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 import PackageDescription let swiftSettings: [SwiftSetting] = [ - .unsafeFlags(["-Xfrontend", "-strict-concurrency=complete"]), - .unsafeFlags(["-Xfrontend", "-enable-actor-data-race-checks"]), + .enableExperimentalFeature("StrictConcurrency") ] func target(name: String, dependencies: [Target.Dependency] = []) -> Target { diff --git a/Examples/App.xcodeproj/project.pbxproj b/Examples/Project.xcodeproj/project.pbxproj similarity index 68% rename from Examples/App.xcodeproj/project.pbxproj rename to Examples/Project.xcodeproj/project.pbxproj index 5560971a..8fab08ce 100644 --- a/Examples/App.xcodeproj/project.pbxproj +++ b/Examples/Project.xcodeproj/project.pbxproj @@ -7,85 +7,85 @@ objects = { /* Begin PBXBuildFile section */ - 1005C4AC9120BA9DA0689543 /* CrossPlatform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452C2B75E438AB4621F094DF /* CrossPlatform.swift */; }; - 1107A8B553508AB86E1F5BBB /* CrossPlatformApp in Frameworks */ = {isa = PBXBuildFile; productRef = A708E16BF51AE12E22A59212 /* CrossPlatformApp */; }; - 22426BE1FC37FDA1A0F3DDE4 /* iOSApp in Frameworks */ = {isa = PBXBuildFile; productRef = DED302B138966E5FE400892D /* iOSApp */; }; - 83B07647E2C4BC457F6A4AD4 /* iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDA500C4AECAAC64CB3CF447 /* iOS.swift */; }; - D23E13D8439A165AB04F574E /* CrossPlatform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452C2B75E438AB4621F094DF /* CrossPlatform.swift */; }; - FC3C5D2718645D5C1288E80E /* CrossPlatformApp in Frameworks */ = {isa = PBXBuildFile; productRef = E6D0E7940B1382E3FCA5A833 /* CrossPlatformApp */; }; + 1E8B4C883DAAD55D9B45EDB5 /* CrossPlatform.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD889A29A6D24943E6DD67A7 /* CrossPlatform.swift */; }; + 258659D145562A26A2FEABFE /* CrossPlatformApp in Frameworks */ = {isa = PBXBuildFile; productRef = F68FEBE9442BF5A9C4299116 /* CrossPlatformApp */; }; + 414AD4B90F8ADFBE1616ACC5 /* iOSApp in Frameworks */ = {isa = PBXBuildFile; productRef = 209011ACD0E8B6FF8A7A9D09 /* iOSApp */; }; + 63B04B07591795E44B0A162B /* CrossPlatformApp in Frameworks */ = {isa = PBXBuildFile; productRef = D138B87E618D8518C6BCE8E2 /* CrossPlatformApp */; }; + 8A2774FA52AA3CCD911E7180 /* iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = C19103B92174B65104B95916 /* iOS.swift */; }; + 8FD641E19A6550790DB13B56 /* CrossPlatform.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD889A29A6D24943E6DD67A7 /* CrossPlatform.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1A46847C164D474B7B747BC0 /* iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 452C2B75E438AB4621F094DF /* CrossPlatform.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrossPlatform.swift; sourceTree = ""; }; - 553572CFE97AE83E420D2F2A /* CrossPlatform.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = CrossPlatform.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 7700279A8EA052C81A41C049 /* CrossPlatform */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CrossPlatform; path = Packages/CrossPlatform; sourceTree = SOURCE_ROOT; }; - A62E7924E6736516B102BF53 /* iOS */ = {isa = PBXFileReference; lastKnownFileType = folder; name = iOS; path = Packages/iOS; sourceTree = SOURCE_ROOT; }; - B0EB7D420C3AF1A10913B76C /* CrossPlatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CrossPlatform.app; sourceTree = BUILT_PRODUCTS_DIR; }; - CDA500C4AECAAC64CB3CF447 /* iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOS.swift; sourceTree = ""; }; + 0D16CBF0DA140E5B52A2923C /* CrossPlatform.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = CrossPlatform.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 475E0D70E2E59F64A0399B8C /* CrossPlatform */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CrossPlatform; path = Packages/CrossPlatform; sourceTree = SOURCE_ROOT; }; + 6CC36E8E390BAE4F78187AE8 /* CrossPlatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CrossPlatform.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B325F946969A2DCE2C795CCF /* iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C19103B92174B65104B95916 /* iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOS.swift; sourceTree = ""; }; + DD889A29A6D24943E6DD67A7 /* CrossPlatform.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrossPlatform.swift; sourceTree = ""; }; + F1130EBC979D3A0C19F5CBD6 /* iOS */ = {isa = PBXFileReference; lastKnownFileType = folder; name = iOS; path = Packages/iOS; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 396884BFDDC5D978330A4B37 /* Frameworks */ = { + 10CF4AF7FE02DF8DA46AE8E7 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - FC3C5D2718645D5C1288E80E /* CrossPlatformApp in Frameworks */, + 414AD4B90F8ADFBE1616ACC5 /* iOSApp in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 616B90122D0F767296E406C2 /* Frameworks */ = { + A6B8CA9108FF95CB6E4262FE /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1107A8B553508AB86E1F5BBB /* CrossPlatformApp in Frameworks */, + 258659D145562A26A2FEABFE /* CrossPlatformApp in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - FC0E41DC167719D0F263590D /* Frameworks */ = { + BB079C5F95194BCCA261817B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 22426BE1FC37FDA1A0F3DDE4 /* iOSApp in Frameworks */, + 63B04B07591795E44B0A162B /* CrossPlatformApp in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 4102E3E068508DD683953C7D = { + 1F2DE413CF2CB54988158172 /* App */ = { isa = PBXGroup; children = ( - 443E9F32F0EC65EEBF466F3B /* App */, - A09E2501204CB86B4B2B6562 /* Packages */, - E9C3DB3EC6D7655028A9C0D3 /* Products */, + DD889A29A6D24943E6DD67A7 /* CrossPlatform.swift */, + C19103B92174B65104B95916 /* iOS.swift */, ); + path = App; sourceTree = ""; }; - 443E9F32F0EC65EEBF466F3B /* App */ = { + 293D0FF827366B513839236A = { isa = PBXGroup; children = ( - 452C2B75E438AB4621F094DF /* CrossPlatform.swift */, - CDA500C4AECAAC64CB3CF447 /* iOS.swift */, + 1F2DE413CF2CB54988158172 /* App */, + A333A3A8D6366A46FB38C5DD /* Packages */, + AC523591AC7BE9275003D2DB /* Products */, ); - path = App; sourceTree = ""; }; - A09E2501204CB86B4B2B6562 /* Packages */ = { + A333A3A8D6366A46FB38C5DD /* Packages */ = { isa = PBXGroup; children = ( - 7700279A8EA052C81A41C049 /* CrossPlatform */, - A62E7924E6736516B102BF53 /* iOS */, + 475E0D70E2E59F64A0399B8C /* CrossPlatform */, + F1130EBC979D3A0C19F5CBD6 /* iOS */, ); path = Packages; sourceTree = ""; }; - E9C3DB3EC6D7655028A9C0D3 /* Products */ = { + AC523591AC7BE9275003D2DB /* Products */ = { isa = PBXGroup; children = ( - B0EB7D420C3AF1A10913B76C /* CrossPlatform.app */, - 553572CFE97AE83E420D2F2A /* CrossPlatform.app */, - 1A46847C164D474B7B747BC0 /* iOS.app */, + 6CC36E8E390BAE4F78187AE8 /* CrossPlatform.app */, + 0D16CBF0DA140E5B52A2923C /* CrossPlatform.app */, + B325F946969A2DCE2C795CCF /* iOS.app */, ); name = Products; sourceTree = ""; @@ -93,12 +93,12 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 0B9FD0BB6D9928064433FF9B /* CrossPlatform_macOS */ = { + 161C97D2DD96DC87F9E4A3CE /* CrossPlatform_macOS */ = { isa = PBXNativeTarget; - buildConfigurationList = D736F6769FE19C126BB0E570 /* Build configuration list for PBXNativeTarget "CrossPlatform_macOS" */; + buildConfigurationList = 489E9CD49D2EA9949CF4A0F6 /* Build configuration list for PBXNativeTarget "CrossPlatform_macOS" */; buildPhases = ( - 99DA4BE5E7DD2B2421648BF9 /* Sources */, - 396884BFDDC5D978330A4B37 /* Frameworks */, + 6C259BE0FAC0E6FE44EC9A20 /* Sources */, + BB079C5F95194BCCA261817B /* Frameworks */, ); buildRules = ( ); @@ -106,71 +106,71 @@ ); name = CrossPlatform_macOS; packageProductDependencies = ( - E6D0E7940B1382E3FCA5A833 /* CrossPlatformApp */, + D138B87E618D8518C6BCE8E2 /* CrossPlatformApp */, ); productName = CrossPlatform_macOS; - productReference = B0EB7D420C3AF1A10913B76C /* CrossPlatform.app */; + productReference = 6CC36E8E390BAE4F78187AE8 /* CrossPlatform.app */; productType = "com.apple.product-type.application"; }; - BCC0364CCD17BA05FD5B35BD /* CrossPlatform_tvOS */ = { + 21E45A47F250941DC4D03BF5 /* iOS */ = { isa = PBXNativeTarget; - buildConfigurationList = 5692190C256999FACA68657C /* Build configuration list for PBXNativeTarget "CrossPlatform_tvOS" */; + buildConfigurationList = D6630AA77A4C90845A3CD3FC /* Build configuration list for PBXNativeTarget "iOS" */; buildPhases = ( - 45830C9A5E17EEEBAD5BB38C /* Sources */, - 616B90122D0F767296E406C2 /* Frameworks */, + 9CB5A1CC0201D5CB7A74AECB /* Sources */, + 10CF4AF7FE02DF8DA46AE8E7 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); - name = CrossPlatform_tvOS; + name = iOS; packageProductDependencies = ( - A708E16BF51AE12E22A59212 /* CrossPlatformApp */, + 209011ACD0E8B6FF8A7A9D09 /* iOSApp */, ); - productName = CrossPlatform_tvOS; - productReference = 553572CFE97AE83E420D2F2A /* CrossPlatform.app */; + productName = iOS; + productReference = B325F946969A2DCE2C795CCF /* iOS.app */; productType = "com.apple.product-type.application"; }; - E002849B581BDA9D70A3A4C9 /* iOS */ = { + B1F2F6767CFBA1893D633A4B /* CrossPlatform_tvOS */ = { isa = PBXNativeTarget; - buildConfigurationList = C721B957640FFBE59EA77850 /* Build configuration list for PBXNativeTarget "iOS" */; + buildConfigurationList = 92498FEFF319BA093A0C4BC9 /* Build configuration list for PBXNativeTarget "CrossPlatform_tvOS" */; buildPhases = ( - 8A0E1982AB0E2C9C11C649C4 /* Sources */, - FC0E41DC167719D0F263590D /* Frameworks */, + 59AE5F6F03AC0E7F21ADF542 /* Sources */, + A6B8CA9108FF95CB6E4262FE /* Frameworks */, ); buildRules = ( ); dependencies = ( ); - name = iOS; + name = CrossPlatform_tvOS; packageProductDependencies = ( - DED302B138966E5FE400892D /* iOSApp */, + F68FEBE9442BF5A9C4299116 /* CrossPlatformApp */, ); - productName = iOS; - productReference = 1A46847C164D474B7B747BC0 /* iOS.app */; + productName = CrossPlatform_tvOS; + productReference = 0D16CBF0DA140E5B52A2923C /* CrossPlatform.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 6B590BF25178DC7D824D09CE /* Project object */ = { + 0FBAE303E3CFC2ABAC876A77 /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; LastUpgradeCheck = 1430; TargetAttributes = { - 0B9FD0BB6D9928064433FF9B = { + 161C97D2DD96DC87F9E4A3CE = { ProvisioningStyle = Manual; }; - BCC0364CCD17BA05FD5B35BD = { + 21E45A47F250941DC4D03BF5 = { ProvisioningStyle = Manual; }; - E002849B581BDA9D70A3A4C9 = { + B1F2F6767CFBA1893D633A4B = { ProvisioningStyle = Manual; }; }; }; - buildConfigurationList = B3FD05C59F197F398A0B04AB /* Build configuration list for PBXProject "App" */; + buildConfigurationList = D91E14E36EC0B415578456F2 /* Build configuration list for PBXProject "Project" */; compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; @@ -178,94 +178,50 @@ Base, en, ); - mainGroup = 4102E3E068508DD683953C7D; + mainGroup = 293D0FF827366B513839236A; + packageReferences = ( + E33DA6C4A12A51D5FE9E2326 /* XCLocalSwiftPackageReference "Packages/CrossPlatform" */, + 0D7591B851157DD4AFC572BB /* XCLocalSwiftPackageReference "Packages/iOS" */, + ); projectDirPath = ""; projectRoot = ""; targets = ( - 0B9FD0BB6D9928064433FF9B /* CrossPlatform_macOS */, - BCC0364CCD17BA05FD5B35BD /* CrossPlatform_tvOS */, - E002849B581BDA9D70A3A4C9 /* iOS */, + 161C97D2DD96DC87F9E4A3CE /* CrossPlatform_macOS */, + B1F2F6767CFBA1893D633A4B /* CrossPlatform_tvOS */, + 21E45A47F250941DC4D03BF5 /* iOS */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 45830C9A5E17EEEBAD5BB38C /* Sources */ = { + 59AE5F6F03AC0E7F21ADF542 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D23E13D8439A165AB04F574E /* CrossPlatform.swift in Sources */, + 8FD641E19A6550790DB13B56 /* CrossPlatform.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 8A0E1982AB0E2C9C11C649C4 /* Sources */ = { + 6C259BE0FAC0E6FE44EC9A20 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 83B07647E2C4BC457F6A4AD4 /* iOS.swift in Sources */, + 1E8B4C883DAAD55D9B45EDB5 /* CrossPlatform.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 99DA4BE5E7DD2B2421648BF9 /* Sources */ = { + 9CB5A1CC0201D5CB7A74AECB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1005C4AC9120BA9DA0689543 /* CrossPlatform.swift in Sources */, + 8A2774FA52AA3CCD911E7180 /* iOS.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ - 18D388D490A6478296FDA765 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - INFOPLIST_FILE = "App/Info-iOS.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.iOS"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 2D6F7CC6515439E3E37A553A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = "App/Info-CrossPlatform_macOS.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.CrossPlatform-macOS"; - PRODUCT_NAME = CrossPlatform; - SDKROOT = macosx; - }; - name = Debug; - }; - 529068892ED8A16BD72F7E92 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - INFOPLIST_FILE = "App/Info-iOS.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.iOS"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 5C9EF0E6AF4F9491454DE177 /* Release */ = { + 036FCF7C4B48C154279F289D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -320,62 +276,77 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_STRICT_CONCURRENCY = complete; SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Release; }; - 96AC891236E557757EB62931 /* Release */ = { + 0D119B40B422700BFF0170D8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = "App/Info-CrossPlatform_macOS.plist"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "App/Info-iOS.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", - "@executable_path/../Frameworks", + "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.CrossPlatform-macOS"; - PRODUCT_NAME = CrossPlatform; - SDKROOT = macosx; + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.iOS"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; - AA68C62E73C222617BA55DCD /* Debug */ = { + 1F08B6EF907DA88BC5BC83B8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - INFOPLIST_FILE = "App/Info-CrossPlatform_tvOS.plist"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "App/Info-iOS.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.CrossPlatform-tvOS"; - PRODUCT_NAME = CrossPlatform; - SDKROOT = appletvos; - TARGETED_DEVICE_FAMILY = 3; + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.iOS"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - EF7DEC50716629B4CAF47EAF /* Release */ = { + 3197410091D7FC7EADDB0DFB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - INFOPLIST_FILE = "App/Info-CrossPlatform_tvOS.plist"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "App/Info-CrossPlatform_macOS.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", - "@executable_path/Frameworks", + "@executable_path/../Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.CrossPlatform-tvOS"; + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.CrossPlatform-macOS"; PRODUCT_NAME = CrossPlatform; - SDKROOT = appletvos; - TARGETED_DEVICE_FAMILY = 3; + SDKROOT = macosx; }; name = Release; }; - F61063B78755D98B1B9C3697 /* Debug */ = { + 6793BA29E51979132FFCF940 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "App/Info-CrossPlatform_macOS.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.CrossPlatform-macOS"; + PRODUCT_NAME = CrossPlatform; + SDKROOT = macosx; + }; + name = Debug; + }; + 999683C4B5329A72D12AD584 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -437,66 +408,112 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_STRICT_CONCURRENCY = complete; SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Debug; }; + CAEA319339AB570A53207A65 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = "App/Info-CrossPlatform_tvOS.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.CrossPlatform-tvOS"; + PRODUCT_NAME = CrossPlatform; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + }; + name = Release; + }; + E01B5DD63B75617BADA80FDD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = "App/Info-CrossPlatform_tvOS.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-atom-properties.examples.CrossPlatform-tvOS"; + PRODUCT_NAME = CrossPlatform; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + }; + name = Debug; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 5692190C256999FACA68657C /* Build configuration list for PBXNativeTarget "CrossPlatform_tvOS" */ = { + 489E9CD49D2EA9949CF4A0F6 /* Build configuration list for PBXNativeTarget "CrossPlatform_macOS" */ = { isa = XCConfigurationList; buildConfigurations = ( - AA68C62E73C222617BA55DCD /* Debug */, - EF7DEC50716629B4CAF47EAF /* Release */, + 6793BA29E51979132FFCF940 /* Debug */, + 3197410091D7FC7EADDB0DFB /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - B3FD05C59F197F398A0B04AB /* Build configuration list for PBXProject "App" */ = { + 92498FEFF319BA093A0C4BC9 /* Build configuration list for PBXNativeTarget "CrossPlatform_tvOS" */ = { isa = XCConfigurationList; buildConfigurations = ( - F61063B78755D98B1B9C3697 /* Debug */, - 5C9EF0E6AF4F9491454DE177 /* Release */, + E01B5DD63B75617BADA80FDD /* Debug */, + CAEA319339AB570A53207A65 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - C721B957640FFBE59EA77850 /* Build configuration list for PBXNativeTarget "iOS" */ = { + D6630AA77A4C90845A3CD3FC /* Build configuration list for PBXNativeTarget "iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( - 18D388D490A6478296FDA765 /* Debug */, - 529068892ED8A16BD72F7E92 /* Release */, + 1F08B6EF907DA88BC5BC83B8 /* Debug */, + 0D119B40B422700BFF0170D8 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - D736F6769FE19C126BB0E570 /* Build configuration list for PBXNativeTarget "CrossPlatform_macOS" */ = { + D91E14E36EC0B415578456F2 /* Build configuration list for PBXProject "Project" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2D6F7CC6515439E3E37A553A /* Debug */, - 96AC891236E557757EB62931 /* Release */, + 999683C4B5329A72D12AD584 /* Debug */, + 036FCF7C4B48C154279F289D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 0D7591B851157DD4AFC572BB /* XCLocalSwiftPackageReference "Packages/iOS" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Packages/iOS; + }; + E33DA6C4A12A51D5FE9E2326 /* XCLocalSwiftPackageReference "Packages/CrossPlatform" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Packages/CrossPlatform; + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCSwiftPackageProductDependency section */ - A708E16BF51AE12E22A59212 /* CrossPlatformApp */ = { + 209011ACD0E8B6FF8A7A9D09 /* iOSApp */ = { isa = XCSwiftPackageProductDependency; - productName = CrossPlatformApp; + productName = iOSApp; }; - DED302B138966E5FE400892D /* iOSApp */ = { + D138B87E618D8518C6BCE8E2 /* CrossPlatformApp */ = { isa = XCSwiftPackageProductDependency; - productName = iOSApp; + productName = CrossPlatformApp; }; - E6D0E7940B1382E3FCA5A833 /* CrossPlatformApp */ = { + F68FEBE9442BF5A9C4299116 /* CrossPlatformApp */ = { isa = XCSwiftPackageProductDependency; productName = CrossPlatformApp; }; /* End XCSwiftPackageProductDependency section */ }; - rootObject = 6B590BF25178DC7D824D09CE /* Project object */; + rootObject = 0FBAE303E3CFC2ABAC876A77 /* Project object */; } diff --git a/Examples/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Examples/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Examples/Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Examples/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/Project.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Examples/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Examples/Project.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Examples/project.yml b/Examples/project.yml index 425fcfe2..f3e297e6 100644 --- a/Examples/project.yml +++ b/Examples/project.yml @@ -1,4 +1,4 @@ -name: App +name: Project options: deploymentTarget: @@ -12,6 +12,7 @@ settings: CODE_SIGNING_REQUIRED: NO CODE_SIGN_IDENTITY: "-" CODE_SIGN_STYLE: Manual + SWIFT_STRICT_CONCURRENCY: complete targetTemplates: App: diff --git a/Makefile b/Makefile index ba1f75f7..a90e619b 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,6 @@ SWIFT_FILE_PATHS = Package.swift Tools/Package.swift Sources Tests Examples Benc XCODEGEN = SWIFT_PACKAGE_RESOURCES=Tools/.build/checkouts/XcodeGen/SettingPresets $(TOOL) xcodegen SWIFTFORMAT = $(TOOL) swift-format -.PHONY: open-dev -open-dev: - DEVELOPMENT=1 open Package.swift - .PHONY: proj proj: $(XCODEGEN) -s Examples/project.yml diff --git a/Package.swift b/Package.swift index e377a1e8..3c11985f 100644 --- a/Package.swift +++ b/Package.swift @@ -1,8 +1,12 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 import Foundation import PackageDescription +let swiftSettings: [SwiftSetting] = [ + .enableExperimentalFeature("StrictConcurrency") +] + let package = Package( name: "swiftui-atom-properties", platforms: [ @@ -15,20 +19,15 @@ let package = Package( .library(name: "Atoms", targets: ["Atoms"]) ], targets: [ - .target(name: "Atoms"), + .target( + name: "Atoms", + swiftSettings: swiftSettings + ), .testTarget( name: "AtomsTests", - dependencies: ["Atoms"] + dependencies: ["Atoms"], + swiftSettings: swiftSettings ), ], swiftLanguageVersions: [.v5] ) - -if ProcessInfo.processInfo.environment["DEVELOPMENT"] != nil { - for target in package.targets { - target.swiftSettings = [ - .unsafeFlags(["-Xfrontend", "-strict-concurrency=complete"]), - .unsafeFlags(["-Xfrontend", "-enable-actor-data-race-checks"]), - ] - } -} diff --git a/README.md b/README.md index 92ab5dc5..7eb91875 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ struct CounterView: View { A simple demo that demonstrates how to do [time travel debugging](https://en.wikipedia.org/wiki/Time_travel_debugging) with this library. Each example has a test target too to demonstrate how to test your atoms with dependency injection. -Open `Examples/App.xcodeproj` and play around with it! +Open `Examples/Project.xcodeproj` and play around with it! --- @@ -127,8 +127,8 @@ Open `Examples/App.xcodeproj` and play around with it! | |Minimum Version| |------:|--------------:| -|Swift |5.9 | -|Xcode |15.2 | +|Swift |5.10 | +|Xcode |15.4 | |iOS |14.0 | |macOS |11.0 | |tvOS |14.0 | diff --git a/Sources/Atoms/Atom/PublisherAtom.swift b/Sources/Atoms/Atom/PublisherAtom.swift index 87d78e77..24c3676c 100644 --- a/Sources/Atoms/Atom/PublisherAtom.swift +++ b/Sources/Atoms/Atom/PublisherAtom.swift @@ -1,4 +1,4 @@ -import Combine +@preconcurrency import Combine /// An atom type that provides a sequence of values of the given `Publisher` as an ``AsyncPhase`` value. /// diff --git a/Sources/Atoms/Atom/TaskAtom.swift b/Sources/Atoms/Atom/TaskAtom.swift index 971a990c..8e48c023 100644 --- a/Sources/Atoms/Atom/TaskAtom.swift +++ b/Sources/Atoms/Atom/TaskAtom.swift @@ -54,7 +54,7 @@ public protocol TaskAtom: AsyncAtom where Produced == Task { public extension TaskAtom { var producer: AtomProducer { AtomProducer { context in - Task { [value] in + Task { await context.transaction(value) } } manageValue: { task, context in @@ -64,7 +64,7 @@ public extension TaskAtom { var refreshProducer: AtomRefreshProducer { AtomRefreshProducer { context in - Task { [value] in + Task { await context.transaction(value) } } refreshValue: { task, context in diff --git a/Sources/Atoms/Atom/ThrowingTaskAtom.swift b/Sources/Atoms/Atom/ThrowingTaskAtom.swift index e62665e0..0a77070a 100644 --- a/Sources/Atoms/Atom/ThrowingTaskAtom.swift +++ b/Sources/Atoms/Atom/ThrowingTaskAtom.swift @@ -58,7 +58,7 @@ public protocol ThrowingTaskAtom: AsyncAtom where Produced == Task { AtomProducer { context in - Task { [value] in + Task { try await context.transaction(value) } } manageValue: { task, context in @@ -68,7 +68,7 @@ public extension ThrowingTaskAtom { var refreshProducer: AtomRefreshProducer { AtomRefreshProducer { context in - Task { [value] in + Task { try await context.transaction(value) } } refreshValue: { task, context in diff --git a/Sources/Atoms/Context/AtomTestContext.swift b/Sources/Atoms/Context/AtomTestContext.swift index e042f1ee..dc97a8c0 100644 --- a/Sources/Atoms/Context/AtomTestContext.swift +++ b/Sources/Atoms/Context/AtomTestContext.swift @@ -1,4 +1,4 @@ -import Combine +@preconcurrency import Combine /// A context structure to read, watch, and otherwise interact with atoms in testing. /// diff --git a/Sources/Atoms/Core/Atom/Atom.swift b/Sources/Atoms/Core/Atom/Atom.swift index e29c3506..f30b9047 100644 --- a/Sources/Atoms/Core/Atom/Atom.swift +++ b/Sources/Atoms/Core/Atom/Atom.swift @@ -2,7 +2,7 @@ /// /// The value produced by an atom is created only when the atom is watched from somewhere, /// and is immediately released when no longer watched. -public protocol Atom { +public protocol Atom: Sendable { /// A type representing the stable identity of this atom. associatedtype Key: Hashable diff --git a/Sources/Atoms/Core/Modifier/AtomModifier.swift b/Sources/Atoms/Core/Modifier/AtomModifier.swift index 45c8822e..ff920616 100644 --- a/Sources/Atoms/Core/Modifier/AtomModifier.swift +++ b/Sources/Atoms/Core/Modifier/AtomModifier.swift @@ -9,7 +9,7 @@ public extension Atom { } /// A modifier that you apply to an atom, producing a new value modified from the original value. -public protocol AtomModifier { +public protocol AtomModifier: Sendable { /// A type representing the stable identity of this modifier. associatedtype Key: Hashable diff --git a/Sources/Atoms/Core/StoreState.swift b/Sources/Atoms/Core/StoreState.swift index 22570339..88b784a9 100644 --- a/Sources/Atoms/Core/StoreState.swift +++ b/Sources/Atoms/Core/StoreState.swift @@ -3,4 +3,6 @@ internal final class StoreState { var caches = [AtomKey: any AtomCacheProtocol]() var states = [AtomKey: any AtomStateProtocol]() var subscriptions = [AtomKey: [SubscriberKey: Subscription]]() + + nonisolated init() {} } diff --git a/Sources/Atoms/Core/Subscriber.swift b/Sources/Atoms/Core/Subscriber.swift index 8d2ab4ae..e1e44bee 100644 --- a/Sources/Atoms/Core/Subscriber.swift +++ b/Sources/Atoms/Core/Subscriber.swift @@ -11,12 +11,12 @@ internal struct Subscriber { } var subscribing: Set { - get { state?.subscribing ?? [] } - nonmutating set { state?.subscribing = newValue } + get { state?.subscribing.value ?? [] } + nonmutating set { state?.subscribing.value = newValue } } var unsubscribe: ((Set) -> Void)? { - get { state?.unsubscribe } - nonmutating set { state?.unsubscribe = newValue } + get { state?.unsubscribe.value } + nonmutating set { state?.unsubscribe.value = newValue } } } diff --git a/Sources/Atoms/Core/SubscriberState.swift b/Sources/Atoms/Core/SubscriberState.swift index 0b2a3ba9..7ca27db9 100644 --- a/Sources/Atoms/Core/SubscriberState.swift +++ b/Sources/Atoms/Core/SubscriberState.swift @@ -3,18 +3,18 @@ import Foundation @MainActor internal final class SubscriberState { let token = SubscriberKey.Token() - var subscribing = Set() - var unsubscribe: ((Set) -> Void)? + var subscribing = UnsafeUncheckedSendable(Set()) + var unsubscribe = UnsafeUncheckedSendable<((Set) -> Void)?>(nil) // TODO: Use isolated synchronous deinit once it's available. // 0371-isolated-synchronous-deinit deinit { if Thread.isMainThread { - unsubscribe?(subscribing) + unsubscribe.value?(subscribing.value) } else { - Task(priority: .high) { @MainActor [unsubscribe, subscribing] in - unsubscribe?(subscribing) + Task { @MainActor [unsubscribe, subscribing] in + unsubscribe.value?(subscribing.value) } } } diff --git a/Sources/Atoms/Core/UnsafeUncheckedSendable.swift b/Sources/Atoms/Core/UnsafeUncheckedSendable.swift new file mode 100644 index 00000000..781e196b --- /dev/null +++ b/Sources/Atoms/Core/UnsafeUncheckedSendable.swift @@ -0,0 +1,9 @@ +import os + +internal struct UnsafeUncheckedSendable: @unchecked Sendable { + var value: Value + + init(_ value: Value) { + self.value = value + } +} diff --git a/Sources/Atoms/Deprecated.swift b/Sources/Atoms/Deprecated.swift index 810cea6a..4fbd95a3 100644 --- a/Sources/Atoms/Deprecated.swift +++ b/Sources/Atoms/Deprecated.swift @@ -6,7 +6,7 @@ public extension Atom { @available(*, deprecated, renamed: "changes(of:)") func select( - _ keyPath: KeyPath + _ keyPath: KeyPath & Sendable ) -> ModifiedAtom> { changes(of: keyPath) } diff --git a/Sources/Atoms/Modifier/ChangesOfModifier.swift b/Sources/Atoms/Modifier/ChangesOfModifier.swift index 5f74fe35..a217d6ae 100644 --- a/Sources/Atoms/Modifier/ChangesOfModifier.swift +++ b/Sources/Atoms/Modifier/ChangesOfModifier.swift @@ -49,22 +49,22 @@ public struct ChangesOfModifier: AtomModifier { } } - private let keyPath: KeyPath + private let keyPath: UnsafeUncheckedSendable> internal init(keyPath: KeyPath) { - self.keyPath = keyPath + self.keyPath = UnsafeUncheckedSendable(keyPath) } /// A unique value used to identify the modifier internally. public var key: Key { - Key(keyPath: keyPath) + Key(keyPath: keyPath.value) } /// A producer that produces the value of this atom. public func producer(atom: some Atom) -> AtomProducer { AtomProducer { context in let value = context.transaction { $0.watch(atom) } - return value[keyPath: keyPath] + return value[keyPath: keyPath.value] } shouldUpdate: { oldValue, newValue in oldValue != newValue } diff --git a/Tests/AtomsTests/Attribute/KeepAliveTests.swift b/Tests/AtomsTests/Attribute/KeepAliveTests.swift index e0b70c73..e664732f 100644 --- a/Tests/AtomsTests/Attribute/KeepAliveTests.swift +++ b/Tests/AtomsTests/Attribute/KeepAliveTests.swift @@ -5,7 +5,7 @@ import XCTest final class KeepAliveTests: XCTestCase { @MainActor func testKeepAliveAtoms() { - struct KeepAliveAtom: ValueAtom, KeepAlive, Hashable { + struct KeepAliveAtom: ValueAtom, KeepAlive, Hashable, @unchecked Sendable { let value: T func value(context: Context) -> T { @@ -13,7 +13,7 @@ final class KeepAliveTests: XCTestCase { } } - struct ScopedKeepAliveAtom: ValueAtom, KeepAlive, Scoped, Hashable { + struct ScopedKeepAliveAtom: ValueAtom, KeepAlive, Scoped, Hashable, @unchecked Sendable { let value: T func value(context: Context) -> T { diff --git a/Tests/AtomsTests/Attribute/ScopedTests.swift b/Tests/AtomsTests/Attribute/ScopedTests.swift index ca66a8c6..38c6171a 100644 --- a/Tests/AtomsTests/Attribute/ScopedTests.swift +++ b/Tests/AtomsTests/Attribute/ScopedTests.swift @@ -5,7 +5,7 @@ import XCTest final class ScopedTests: XCTestCase { @MainActor func testScopedAtoms() { - struct ScopedAtom: ValueAtom, Scoped, Equatable { + struct ScopedAtom: ValueAtom, Scoped, Equatable, @unchecked Sendable { let key = UniqueKey() let scopeID: ID let value: T diff --git a/Tests/AtomsTests/Core/StoreContextTests.swift b/Tests/AtomsTests/Core/StoreContextTests.swift index 3996b704..6a9ee160 100644 --- a/Tests/AtomsTests/Core/StoreContextTests.swift +++ b/Tests/AtomsTests/Core/StoreContextTests.swift @@ -1379,7 +1379,7 @@ final class StoreContextTests: XCTestCase { } } - final class SubscriberHost { + final class SubscriberHost: @unchecked Sendable { var subscriberState: SubscriberState? } diff --git a/Tests/AtomsTests/Core/SubscriberStateTests.swift b/Tests/AtomsTests/Core/SubscriberStateTests.swift index 5bd0dd72..9622b102 100644 --- a/Tests/AtomsTests/Core/SubscriberStateTests.swift +++ b/Tests/AtomsTests/Core/SubscriberStateTests.swift @@ -8,7 +8,7 @@ final class SubscriberStateTests: XCTestCase { var subscriberState: SubscriberState? = SubscriberState() var unsubscribedCount = 0 - subscriberState!.unsubscribe = { _ in + subscriberState!.unsubscribe.value = { _ in unsubscribedCount += 1 } diff --git a/Tests/AtomsTests/Core/SubscriberTestsTests.swift b/Tests/AtomsTests/Core/SubscriberTestsTests.swift index be6c045b..c23136e5 100644 --- a/Tests/AtomsTests/Core/SubscriberTestsTests.swift +++ b/Tests/AtomsTests/Core/SubscriberTestsTests.swift @@ -35,7 +35,7 @@ final class SubscriberTests: XCTestCase { subscriber.subscribing = expected - XCTAssertEqual(state?.subscribing, expected) + XCTAssertEqual(state?.subscribing.value, expected) state = nil @@ -52,7 +52,7 @@ final class SubscriberTests: XCTestCase { isUnsubscribed = true } - state?.unsubscribe?([]) + state?.unsubscribe.value?([]) XCTAssertTrue(isUnsubscribed) diff --git a/Tests/AtomsTests/Utilities/TestAtom.swift b/Tests/AtomsTests/Utilities/TestAtom.swift index 381ef464..1647cdbc 100644 --- a/Tests/AtomsTests/Utilities/TestAtom.swift +++ b/Tests/AtomsTests/Utilities/TestAtom.swift @@ -2,7 +2,7 @@ import Combine @testable import Atoms -struct TestAtom: ValueAtom, Hashable { +struct TestAtom: ValueAtom, Hashable, @unchecked Sendable { var value: T func value(context: Context) -> T { @@ -10,7 +10,7 @@ struct TestAtom: ValueAtom, Hashable { } } -struct TestValueAtom: ValueAtom { +struct TestValueAtom: ValueAtom, @unchecked Sendable { var value: T var effect: TestEffect? @@ -27,7 +27,7 @@ struct TestValueAtom: ValueAtom { } } -struct TestStateAtom: StateAtom { +struct TestStateAtom: StateAtom, @unchecked Sendable { var defaultValue: T var effect: TestEffect? @@ -44,7 +44,7 @@ struct TestStateAtom: StateAtom { } } -struct TestTaskAtom: TaskAtom { +struct TestTaskAtom: TaskAtom, @unchecked Sendable { var effect: TestEffect? var getValue: () -> T @@ -61,7 +61,7 @@ struct TestTaskAtom: TaskAtom { } } -struct TestThrowingTaskAtom: ThrowingTaskAtom { +struct TestThrowingTaskAtom: ThrowingTaskAtom, @unchecked Sendable { var effect: TestEffect? var getResult: () -> Result @@ -78,7 +78,7 @@ struct TestThrowingTaskAtom: ThrowingTaskAtom { } } -struct TestCustomRefreshableAtom: ValueAtom, Refreshable { +struct TestCustomRefreshableAtom: ValueAtom, Refreshable, @unchecked Sendable { var getValue: (Context) -> T var refresh: (CurrentContext) async -> T @@ -95,7 +95,7 @@ struct TestCustomRefreshableAtom: ValueAtom, Refreshable { } } -struct TestCustomResettableAtom: StateAtom, Resettable { +struct TestCustomResettableAtom: StateAtom, Resettable, @unchecked Sendable { var defaultValue: (Context) -> T var reset: (CurrentContext) -> Void @@ -112,7 +112,7 @@ struct TestCustomResettableAtom: StateAtom, Resettable { } } -struct TestPublisherAtom: PublisherAtom where Publisher.Output: Sendable { +struct TestPublisherAtom: PublisherAtom, @unchecked Sendable where Publisher.Output: Sendable { var effect: TestEffect? var makePublisher: () -> Publisher @@ -129,7 +129,7 @@ struct TestPublisherAtom: PublisherAtom where Publ } } -struct TestAsyncSequenceAtom: AsyncSequenceAtom where Sequence.Element: Sendable { +struct TestAsyncSequenceAtom: AsyncSequenceAtom, @unchecked Sendable where Sequence.Element: Sendable { var effect: TestEffect? var makeSequence: () -> Sequence @@ -146,7 +146,7 @@ struct TestAsyncSequenceAtom: AsyncSequenceAtom where S } } -struct TestObservableObjectAtom: ObservableObjectAtom { +struct TestObservableObjectAtom: ObservableObjectAtom, @unchecked Sendable { var effect: TestEffect? var key: UniqueKey { diff --git a/Tests/AtomsTests/Utilities/Utilities.swift b/Tests/AtomsTests/Utilities/Utilities.swift index 99c8f674..87430392 100644 --- a/Tests/AtomsTests/Utilities/Utilities.swift +++ b/Tests/AtomsTests/Utilities/Utilities.swift @@ -33,7 +33,7 @@ final class TestObservableObject: ObservableObject, @unchecked Sendable { } } -final class AsyncThrowingStreamPipe { +final class AsyncThrowingStreamPipe: @unchecked Sendable { private(set) var stream: AsyncThrowingStream private(set) var continuation: AsyncThrowingStream.Continuation diff --git a/Tools/Package.resolved b/Tools/Package.resolved index 7b141b4d..85cb4986 100644 --- a/Tools/Package.resolved +++ b/Tools/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "eaa10925341d06ca847c182626c709d014e4b62c8401b5b6545f08c0b096e23f", "pins" : [ { "identity" : "aexml", @@ -9,15 +10,6 @@ "version" : "4.6.1" } }, - { - "identity" : "graphviz", - "kind" : "remoteSourceControl", - "location" : "https://github.com/SwiftDocOrg/GraphViz.git", - "state" : { - "revision" : "70bebcf4597b9ce33e19816d6bbd4ba9b7bdf038", - "version" : "0.2.0" - } - }, { "identity" : "jsonutilities", "kind" : "remoteSourceControl", @@ -77,14 +69,14 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-docc-plugin", "state" : { - "revision" : "26ac5758409154cc448d7ab82389c520fa8a8247", - "version" : "1.3.0" + "revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64", + "version" : "1.4.3" } }, { "identity" : "swift-docc-symbolkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-docc-symbolkit", + "location" : "https://github.com/swiftlang/swift-docc-symbolkit", "state" : { "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", "version" : "1.0.0" @@ -95,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-format.git", "state" : { - "revision" : "83248b4fa37919f78ffbd4650946759bcc54c2b5", - "version" : "509.0.0" + "revision" : "7996ac678197d293f6c088a1e74bb778b4e10139", + "version" : "510.1.0" } }, { @@ -113,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-syntax.git", "state" : { - "revision" : "64889f0c732f210a935a0ad7cda38f77f876262d", - "version" : "509.1.1" + "revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82", + "version" : "510.0.3" } }, { @@ -140,8 +132,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/yonaskolb/XcodeGen.git", "state" : { - "revision" : "9816466703aede482c7436fddc6535684a7a9168", - "version" : "2.40.1" + "revision" : "82c6ab9bbd5b6075fc0887d897733fc0c4ffc9ab", + "version" : "2.42.0" } }, { @@ -149,8 +141,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/XcodeProj.git", "state" : { - "revision" : "6e60fb55271c80f83a186c9b1b4982fd991cfc0a", - "version" : "8.13.0" + "revision" : "447c159b0c5fb047a024fd8d942d4a76cf47dde0", + "version" : "8.16.0" } }, { @@ -163,5 +155,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Tools/Package.swift b/Tools/Package.swift index dfb0499f..2d377acc 100644 --- a/Tools/Package.swift +++ b/Tools/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 import PackageDescription @@ -6,8 +6,8 @@ let package = Package( name: "dev-tools", dependencies: [ .package(name: "swiftui-atom-properties", path: ".."), - .package(url: "https://github.com/apple/swift-docc-plugin", exact: "1.3.0"), - .package(url: "https://github.com/apple/swift-format.git", exact: "509.0.0"), - .package(url: "https://github.com/yonaskolb/XcodeGen.git", exact: "2.40.1"), + .package(url: "https://github.com/apple/swift-docc-plugin", exact: "1.4.3"), + .package(url: "https://github.com/apple/swift-format.git", exact: "510.1.0"), + .package(url: "https://github.com/yonaskolb/XcodeGen.git", exact: "2.42.0"), ] ) diff --git a/scripts/test.sh b/scripts/test.sh index 64af5a58..4f1aea70 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -5,8 +5,6 @@ set -eu TARGET=$1 PLATFORM=$2 -export DEVELOPMENT=1 - pushd "$(cd $(dirname $0)/.. && pwd)" &>/dev/null case $PLATFORM in