From d8f3ae981886b8d6000c49078c59e5758cb32fc0 Mon Sep 17 00:00:00 2001 From: Varun Santhanam Date: Mon, 25 May 2026 16:15:31 +0100 Subject: [PATCH] Support Swift 6.3 --- .github/workflows/ci.yml | 14 +++++--- .github/workflows/publish-website.yml | 2 +- .scripts/xcode-select | 2 +- .swift-version | 1 + .swiftformat | 8 +++-- Package.resolved | 10 +++--- Package.swift | 6 ++-- Package@swift-6.2.swift | 39 +++++++++++++++++++++++ Tests/ViewScopeTests/ViewScopeTests.swift | 2 +- 9 files changed, 66 insertions(+), 18 deletions(-) create mode 100644 .swift-version create mode 100644 Package@swift-6.2.swift diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a588888..b852466 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,11 +45,14 @@ jobs: strategy: fail-fast: false matrix: - swift: ["6.2"] + swift: ["6.2", "6.3"] include: - swift: "6.2" runner: "macos-26" - xcode: "26.1" + xcode: "26.4.1" + - swift: "6.3" + runner: "macos-26" + xcode: "26.4.1" runs-on: ${{ matrix.runner }} outputs: artifact-name: macos-build @@ -73,11 +76,14 @@ jobs: strategy: fail-fast: false matrix: - swift: ["6.2"] + swift: ["6.2", "6.3"] include: - swift: "6.2" runner: "macos-26" - xcode: "26.1" + xcode: "26.4.1" + - swift: "6.3" + runner: "macos-26" + xcode: "26.4.1" needs: build-macos-spm runs-on: ${{ matrix.runner }} steps: diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml index 4e68772..663eab7 100644 --- a/.github/workflows/publish-website.yml +++ b/.github/workflows/publish-website.yml @@ -20,7 +20,7 @@ jobs: - name: Checkout uses: actions/checkout@v6 - name: Xcode Version - run: ./.scripts/xcode-select + run: ./.scripts/xcode-select 26.4.1 - name: Build Documentation run: ./.scripts/build-static-docc - name: Compress Documentation diff --git a/.scripts/xcode-select b/.scripts/xcode-select index 3e65eb9..9d63ec5 100755 --- a/.scripts/xcode-select +++ b/.scripts/xcode-select @@ -1,5 +1,5 @@ #!/bin/bash -VERSION="${1:-26.1}" +VERSION="${1:-26.4.1}" sudo xcode-select --switch "/Applications/Xcode_${VERSION}.app" \ No newline at end of file diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..39ee137 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +6.3.1 \ No newline at end of file diff --git a/.swiftformat b/.swiftformat index b543f25..ffc8eb6 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,4 +1,6 @@ --extensionacl on-declarations ---disable blankLinesAtEndOfScope, blankLinesAtStartOfScope, redundantNilInit, unusedArguments, redundantParens, wrapMultilineStatementBraces, trailingCommas, braces, opaqueGenericParameters, redundantSelf, spaceAroundOperators ---header "ViewScope\n{file}\n\nMIT License\n\nCopyright (c) 2025 Varun Santhanam\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\n\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE." ---swift-version 6.2 \ No newline at end of file +--test-case-name-format preserve +--suite-name-format preserve +--enable testSuiteAccessControl +--disable simplifyGenericConstraints, blankLinesAtEndOfScope, blankLinesAtStartOfScope, redundantNilInit, unusedArguments, redundantParens, wrapMultilineStatementBraces, trailingCommas, braces, opaqueGenericParameters, redundantSelf, spaceAroundOperators, redundantSwiftTestingSuite, redundantMemberwiseInit +--header "ViewScope\n{file}\n\nMIT License\n\nCopyright (c) 2025 Varun Santhanam\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\n\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE." \ No newline at end of file diff --git a/Package.resolved b/Package.resolved index a86457b..14d16f2 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "0194367da6cbf419ee77817c596b042c198b0a3263d84f4c663dd1e263199f3d", + "originHash" : "f88b52264ed9f54415cf17d7675fc3994f230091daa77a63e41e4cb980852f88", "pins" : [ { "identity" : "swift-docc-plugin", "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-docc-plugin.git", "state" : { - "revision" : "3e4f133a77e644a5812911a0513aeb7288b07d06", - "version" : "1.4.5" + "revision" : "647c708be89f834fa6a6d4945442793a77ddf5b6", + "version" : "1.5.0" } }, { @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/nicklockwood/SwiftFormat.git", "state" : { - "revision" : "fb7ce2e469c18017c92523c93fd3b1b9757a4dd1", - "version" : "0.58.7" + "revision" : "a5fa7a6a57abeb834df1b3fa43ea9133137d5ade", + "version" : "0.61.1" } } ], diff --git a/Package.swift b/Package.swift index bfc2a86..e2c620d 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 6.2 +// swift-tools-version: 6.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -22,11 +22,11 @@ let package = Package( dependencies: [ .package( url: "https://github.com/swiftlang/swift-docc-plugin.git", - exact: "1.4.5" + exact: "1.5.0" ), .package( url: "https://github.com/nicklockwood/SwiftFormat.git", - exact: "0.58.7" + exact: "0.61.1" ) ], targets: [ diff --git a/Package@swift-6.2.swift b/Package@swift-6.2.swift new file mode 100644 index 0000000..0c29751 --- /dev/null +++ b/Package@swift-6.2.swift @@ -0,0 +1,39 @@ +// swift-tools-version: 6.2 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "ViewScope", + platforms: [ + .macOS(.v15), + .macCatalyst(.v18), + .iOS(.v18), + .watchOS(.v11), + .tvOS(.v18), + .visionOS(.v2) + ], + products: [ + .library( + name: "ViewScope", + targets: ["ViewScope"] + ) + ], + targets: [ + .target( + name: "ViewScope", + swiftSettings: [ + .enableUpcomingFeature("NonisolatedNonsendingByDefault"), + .enableUpcomingFeature("ExistentialAny") + ] + ), + .testTarget( + name: "ViewScopeTests", + dependencies: ["ViewScope"], + swiftSettings: [ + .enableUpcomingFeature("NonisolatedNonsendingByDefault"), + .enableUpcomingFeature("ExistentialAny") + ] + ) + ] +) diff --git a/Tests/ViewScopeTests/ViewScopeTests.swift b/Tests/ViewScopeTests/ViewScopeTests.swift index 1eb5e38..e905cde 100644 --- a/Tests/ViewScopeTests/ViewScopeTests.swift +++ b/Tests/ViewScopeTests/ViewScopeTests.swift @@ -26,6 +26,6 @@ import Testing @testable import ViewScope -@Test func example() async throws { +@Test func example() { // Write your test here and use APIs like `#expect(...)` to check expected conditions. }