Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -247,14 +258,16 @@ 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
steps:
- 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
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Documentation/Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -794,14 +794,14 @@ swift package plugin safedi-v1-to-v2 --target <YourRootTarget>
```

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
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example Package Integration/Package.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Examples/ExampleTuistIntegration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Examples/ExampleTuistIntegration/Tuist/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Examples/ExampleTuistIntegration/Tuist/Package.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"),
],
)
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Loading