diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36892fd9..5692dbc9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@v6 - name: Select Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_26.4.app/Contents/Developer + run: sudo xcode-select --switch /Applications/Xcode_26.0.app/Contents/Developer - name: Download Platform if: matrix.platforms != 'platform=macOS' run: | @@ -84,7 +84,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@v6 - name: Select Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_26.4.app/Contents/Developer + run: sudo xcode-select --switch /Applications/Xcode_26.0.app/Contents/Developer # `swift-docc-plugin`'s `--warnings-as-errors` scopes to a single # target, so swift-syntax's internal DocC noise stays out of our # strict build. That scoping isn't available via `xcodebuild @@ -94,6 +94,11 @@ jobs: with: command: swift package generate-documentation --target SafeDI --warnings-as-errors + # Example jobs that declare package traits in their .xcodeproj + # (`traits = (…)`) need Xcode 26.4 — the first Xcode that + # surfaces traits in the project file. Other examples run on the + # same baseline as the SafeDI-core jobs above. + spm-package-integration: name: Build Package Integration on Xcode 26 runs-on: macos-26 @@ -103,7 +108,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@v6 - name: Select Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_26.4.app/Contents/Developer + run: sudo xcode-select --switch /Applications/Xcode_26.0.app/Contents/Developer - name: Resolve Package Dependencies uses: ./.github/actions/retry with: @@ -115,10 +120,11 @@ jobs: # path would make Xcode IDE builds fail while the swift build above # still passes. - name: Build Package Integration (xcodebuild) - run: pushd "Examples/Example Package Integration"; xcrun xcodebuild build -skipPackagePluginValidation -skipMacroValidation -scheme ExamplePackageIntegration -destination "generic/platform=iOS"; popd + run: pushd "Examples/Example Package Integration"; xcrun xcodebuild build -skipPackagePluginValidation -skipMacroValidation -scheme ExamplePackageIntegration -destination "platform=macOS"; popd spm-project-integration: name: Build Project Integration on Xcode 26 + # Pinned to 26.4 — project file declares package traits. runs-on: macos-26 permissions: contents: read @@ -139,6 +145,7 @@ jobs: spm-multi-project-integration: name: Build Multi Project Integration on Xcode 26 + # Pinned to 26.4 — project file declares package traits. runs-on: macos-26 permissions: contents: read @@ -159,6 +166,10 @@ jobs: spm-tuist-integration: name: Build Tuist Integration on Xcode 26 + # Pinned to 26.4 (not 26.0) until the SafeDI dependency in + # `Tuist/Package.swift` bumps to a release that ships + # `swift-tools-version: 6.2`. The current pin still declares 6.3, + # which Swift 6.2 rejects when Tuist resolves the manifest. runs-on: macos-26 permissions: contents: read @@ -195,7 +206,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@v6 - name: Select Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_26.4.app/Contents/Developer + run: sudo xcode-select --switch /Applications/Xcode_26.0.app/Contents/Developer - name: Resolve Package Dependencies uses: ./.github/actions/retry with: @@ -218,7 +229,7 @@ jobs: linux: name: Build and Test on Linux runs-on: ubuntu-latest - container: swift:6.3 + container: swift:6.2 permissions: contents: read steps: @@ -247,6 +258,8 @@ jobs: bazel: name: Bazel Build on macOS + # Pinned to Xcode 26.0 — matches BCR's `macos_arm64` runner + # platform defined at https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/bazelci.py runs-on: macos-26 permissions: contents: read @@ -254,7 +267,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@v6 - name: Select Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_26.4.app/Contents/Developer + run: sudo xcode-select --switch /Applications/Xcode_26.0.app/Contents/Developer - name: Build Sources run: bazelisk build //Sources/... - name: Build Example diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 69d50af3..9856c8ee 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,6 +18,15 @@ on: default: false jobs: + # Publish builds SafeDITool against the *latest* Swift toolchain, + # not the project's minimum (declared in Package.swift's + # `swift-tools-version` at the top of + # https://github.com/dfed/SafeDI/blob/main/Package.swift). SafeDITool + # ships as a prebuilt that consumers run through the SafeDIGenerator + # plugin, so it has to handle source written for any Swift version + # downstream consumers are on. Building against the latest + # swift-syntax keeps the prebuilt tolerant of newer constructs; + # an older build would parse-fail on newer consumer code. build-macos: name: Build macOS runs-on: macos-26 diff --git a/Documentation/Manual.md b/Documentation/Manual.md index d05d328c..5c6b7b79 100644 --- a/Documentation/Manual.md +++ b/Documentation/Manual.md @@ -781,7 +781,7 @@ UIKit applications’ natural root is the `UIApplicationDelegate`-conforming app ## Migrating from SafeDI 1.x to 2.x -SafeDI 2.x requires Swift 6.3 or later and does not support CocoaPods. Projects using an earlier Swift version or CocoaPods should use SafeDI 1.x. +SafeDI 2.x requires Swift 6.2 or later and does not support CocoaPods. Projects using an earlier Swift version or CocoaPods should use SafeDI 1.x. SafeDI 2.x also removes support for CSV-based configuration files (`.safedi/configuration/include.csv` and `.safedi/configuration/additionalImportedModules.csv`). Configuration is now done via the `#SafeDIConfiguration` macro. @@ -794,14 +794,14 @@ swift package plugin safedi-v1-to-v2 --target ``` This plugin will: -1. Verify your `swift-tools-version` is 6.3 or later +1. Verify your `swift-tools-version` is 6.2 or later 2. Create a `SafeDIConfiguration.swift` file in your target’s source directory 3. Migrate any existing CSV configuration values into the new `#SafeDIConfiguration` macro 4. Delete the obsolete CSV files ### Manual migration -1. Update your `swift-tools-version` to 6.3 or later +1. Update your `swift-tools-version` to 6.2 or later 2. Update your SafeDI dependency to `from: "2.0.0"` 3. If you have `.safedi/configuration/include.csv` or `.safedi/configuration/additionalImportedModules.csv`, add a `#SafeDIConfiguration` in your root module with the equivalent values and delete the CSV files 4. If you don’t have CSV configuration files and do not need other SafeDI configuration options, no `#SafeDIConfiguration()` declaration is required diff --git a/Examples/Example Package Integration/Package.swift b/Examples/Example Package Integration/Package.swift index 396abfed..d7dc3f35 100644 --- a/Examples/Example Package Integration/Package.swift +++ b/Examples/Example Package Integration/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 6.3 +// swift-tools-version: 6.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/Examples/ExampleTuistIntegration/README.md b/Examples/ExampleTuistIntegration/README.md index 39dd576d..2a45475c 100644 --- a/Examples/ExampleTuistIntegration/README.md +++ b/Examples/ExampleTuistIntegration/README.md @@ -54,10 +54,10 @@ recompiles it on the next `xcodebuild`, no `tuist generate` round-trip. 2. In `Tuist/Package.swift`, depend on SafeDI so its runtime library and `SafeDIToolBinary` artifact bundle are resolved (the plugin requires - `SafeDITool >= 2.0.0-beta-6` for the `--combined-output` flag): + `SafeDITool >= 2.0.0-rc-1` for the `--combined-output` flag): ```swift - .package(url: "https://github.com/dfed/SafeDI.git", from: "2.0.0-beta-6"), + .package(url: "https://github.com/dfed/SafeDI.git", from: "2.0.0-rc-1"), ``` 3. In `Project.swift`, `import SafeDITuist` and call the helpers from each diff --git a/Examples/ExampleTuistIntegration/Tuist/Package.resolved b/Examples/ExampleTuistIntegration/Tuist/Package.resolved index f08f8766..9dc9df9e 100644 --- a/Examples/ExampleTuistIntegration/Tuist/Package.resolved +++ b/Examples/ExampleTuistIntegration/Tuist/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "9a2ba39e37a37d1d62f1851c54a858c308e03a1cff41b420f5453a288eb6e38c", + "originHash" : "59e87ad67b40e34bea3a59195f023f3d07a79bca708fbceebf501ceecd435139", "pins" : [ { "identity" : "safedi", "kind" : "remoteSourceControl", "location" : "https://github.com/dfed/SafeDI.git", "state" : { - "revision" : "f9a1738fd4cfd882d94b9417f1461dafc91d4e78", - "version" : "2.0.0-beta-6" + "revision" : "9bfb656b3b4f7ef5a1e4b6869b3bec0f6e8cce11", + "version" : "2.0.0-rc-1" } }, { diff --git a/Examples/ExampleTuistIntegration/Tuist/Package.swift b/Examples/ExampleTuistIntegration/Tuist/Package.swift index 34d19dd2..85aabbb9 100644 --- a/Examples/ExampleTuistIntegration/Tuist/Package.swift +++ b/Examples/ExampleTuistIntegration/Tuist/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 6.3 +// swift-tools-version: 6.2 // // Consumed by `tuist install`, which invokes SPM to resolve this // manifest. Declaring SafeDI here gives Tuist's SPM integration a @@ -28,6 +28,6 @@ import PackageDescription let package = Package( name: "ExampleTuistIntegration", dependencies: [ - .package(url: "https://github.com/dfed/SafeDI.git", from: "2.0.0-beta-6"), + .package(url: "https://github.com/dfed/SafeDI.git", from: "2.0.0-rc-1"), ], ) diff --git a/Package.swift b/Package.swift index 23eb6963..a252a901 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 6.3 +// swift-tools-version: 6.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import CompilerPluginSupport @@ -48,7 +48,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.4.0"), .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.3.0"), - .package(url: "https://github.com/swiftlang/swift-syntax.git", "603.0.0"..<"605.0.0"), + .package(url: "https://github.com/swiftlang/swift-syntax.git", "602.0.0"..<"605.0.0"), ], targets: [ // Macros diff --git a/Plugins/MigrateSafeDIFromVersionOne/MigrateSafeDIFromVersionOne.swift b/Plugins/MigrateSafeDIFromVersionOne/MigrateSafeDIFromVersionOne.swift index 04f2db31..01732833 100644 --- a/Plugins/MigrateSafeDIFromVersionOne/MigrateSafeDIFromVersionOne.swift +++ b/Plugins/MigrateSafeDIFromVersionOne/MigrateSafeDIFromVersionOne.swift @@ -52,8 +52,8 @@ struct MigrateSafeDIFromVersionOne: CommandPlugin { Diagnostics.error("Could not parse swift-tools-version from Package.swift") return } - guard major > 6 || (major == 6 && minor >= 3) else { - Diagnostics.error("SafeDI 2.x requires swift-tools-version 6.3 or later. Found \(major).\(minor). Update your Package.swift before migrating.") + guard major > 6 || (major == 6 && minor >= 2) else { + Diagnostics.error("SafeDI 2.x requires swift-tools-version 6.2 or later. Found \(major).\(minor). Update your Package.swift before migrating.") return }