Skip to content

Commit

Permalink
Adopt Xcode 16. Drop support for Xcode 15
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed committed Sep 23, 2024
1 parent ec41b96 commit 435393c
Show file tree
Hide file tree
Showing 29 changed files with 406 additions and 618 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:

jobs:
xcodebuild-15:
name: Build with xcodebuild on Xcode 15
name: Build with xcodebuild on Xcode 16
runs-on: macos-14
strategy:
matrix:
platforms: [
'generic/platform=ios',
'platform=macos',
'platform=macOS',
'generic/platform=tvos',
'generic/platform=watchos',
'generic/platform=visionos'
Expand All @@ -24,60 +24,64 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
- name: Download visionOS
if: matrix.platforms == 'generic/platform=visionos'
run: xcodebuild -downloadPlatform visionOS
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- name: Build Framework
run: xcrun xcodebuild -skipMacroValidation -skipPackagePluginValidation build -scheme SafeDI-Package -destination ${{ matrix.platforms }}

spm-package-integration-15:
name: Build Package Integration on Xcode 15
name: Build Package Integration on Xcode 16
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
- name: Build Package Integration
run: xcrun swift build --package-path Examples/ExamplePackageIntegration

spm-project-integration-15:
name: Build Project Integration on Xcode 15
name: Build Project Integration on Xcode 16
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
- name: Replace 'main' branch with the current branch
if: github.event.pull_request.head.repo.full_name == github.repository # Only do this if the branch is from our repo.
run: sed -i '' "s#branch = main;#branch = ${{ github.head_ref || github.ref_name }};#" "Examples/ExampleProjectIntegration/ExampleProjectIntegration.xcodeproj/project.pbxproj"
- name: Build Project Integration
run: pushd Examples/ExampleProjectIntegration; xcrun xcodebuild build -skipPackagePluginValidation -skipMacroValidation -scheme ExampleProjectIntegration; popd

spm-multi-project-integration-15:
name: Build Multi Project Integration on Xcode 15
name: Build Multi Project Integration on Xcode 16
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
- name: Replace 'main' branch with the current branch
if: github.event.pull_request.head.repo.full_name == github.repository # Only do this if the branch is from our repo.
run: sed -i '' "s#branch = main;#branch = ${{ github.head_ref || github.ref_name }};#" "Examples/ExampleMultiProjectIntegration/ExampleMultiProjectIntegration.xcodeproj/project.pbxproj"
- name: Build Project Integration
run: pushd Examples/ExampleMultiProjectIntegration; xcrun xcodebuild build -skipPackagePluginValidation -skipMacroValidation -scheme ExampleMultiProjectIntegration; popd

spm-15:
name: Build and Test on Xcode 15
name: Build and Test on Xcode 16
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
- name: Build and Test Framework
run: |
for i in {1..5}; do # Run tests a few times to ensure code-gen is stable.
Expand All @@ -98,7 +102,7 @@ jobs:
linux:
name: Build and Test on Linux
runs-on: ubuntu-latest
container: swift:5.10
container: swift:6.0
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -129,9 +133,9 @@ jobs:
lint-swift:
name: Lint Swift
runs-on: ubuntu-latest
container: swift:5.10
container: swift:6.0
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Lint Swift
run: swift run --package-path CLI swiftformat --swiftversion 5.10 . --lint
run: swift run --package-path CLI swiftformat --swiftversion 6.0 . --lint
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
- name: Build SafeDITool
run: xcrun swift build -c release --product SafeDITool --arch ${{ matrix.architecture }}
- name: Give SafeDITool executable permissions
Expand Down
7 changes: 4 additions & 3 deletions CLI/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"originHash" : "b043e9190ddd3045375d40ccb608edf659c48e3b9f8e2ee40cc489c8ec3f496d",
"pins" : [
{
"identity" : "swiftformat",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nicklockwood/SwiftFormat",
"state" : {
"revision" : "d6309f7440889427426143b4a0b100b959d3f3e6",
"version" : "0.54.3"
"revision" : "ab6844edb79a7b88dc6320e6cee0a0db7674dac3",
"version" : "0.54.5"
}
}
],
"version" : 2
"version" : 3
}
2 changes: 1 addition & 1 deletion CLI/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1500;
LastUpgradeCheck = 1510;
LastUpgradeCheck = 1600;
TargetAttributes = {
32756FE12B24C042006BDD24 = {
CreatedOnToolsVersion = 15.0.1;
Expand Down Expand Up @@ -383,6 +383,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -438,13 +439,13 @@
MTL_FAST_MATH = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 6.0;
};
name = Release;
};
32756FF22B24C044006BDD24 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ExampleMultiProjectIntegration/ExampleMultiProjectIntegration.entitlements;
Expand Down Expand Up @@ -475,15 +476,13 @@
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
32756FF32B24C044006BDD24 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ExampleMultiProjectIntegration/ExampleMultiProjectIntegration.entitlements;
Expand Down Expand Up @@ -514,7 +513,6 @@
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Examples/ExampleMultiProjectIntegration/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public protocol StringStorage {
}

@Instantiable(fulfillingAdditionalTypes: [StringStorage.self])
extension UserDefaults: Instantiable, StringStorage {
extension UserDefaults: @retroactive Instantiable, StringStorage {
public static func instantiate() -> UserDefaults {
.standard
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/ExamplePackageIntegration/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/swiftlang/swift-syntax.git",
"state" : {
"revision" : "fa8f95c2d536d6620cc2f504ebe8a6167c9fc2dd",
"version" : "510.0.1"
"revision" : "cb53fa1bd3219b0b23ded7dfdd3b2baff266fd25",
"version" : "600.0.0"
}
},
{
Expand Down
22 changes: 20 additions & 2 deletions Examples/ExamplePackageIntegration/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.10
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down Expand Up @@ -34,6 +34,9 @@ let package = Package(
"ChildBModule",
"ChildCModule",
],
swiftSettings: [
.swiftLanguageMode(.v6),
],
plugins: [
.plugin(name: "SafeDIGenerator", package: "SafeDI"),
]
Expand All @@ -44,6 +47,9 @@ let package = Package(
"SafeDI",
"SharedModule",
"GrandchildrenModule",
],
swiftSettings: [
.swiftLanguageMode(.v6),
]
),
.target(
Expand All @@ -52,6 +58,9 @@ let package = Package(
"SafeDI",
"SharedModule",
"GrandchildrenModule",
],
swiftSettings: [
.swiftLanguageMode(.v6),
]
),
.target(
Expand All @@ -60,18 +69,27 @@ let package = Package(
"SafeDI",
"SharedModule",
"GrandchildrenModule",
],
swiftSettings: [
.swiftLanguageMode(.v6),
]
),
.target(
name: "GrandchildrenModule",
dependencies: [
"SafeDI",
"SharedModule",
],
swiftSettings: [
.swiftLanguageMode(.v6),
]
),
.target(
name: "SharedModule",
dependencies: ["SafeDI"]
dependencies: ["SafeDI"],
swiftSettings: [
.swiftLanguageMode(.v6),
]
),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Foundation
import SafeDI
import SharedModule

@Instantiable
@Instantiable @MainActor
public final class Root: Instantiable {
public init(childA: ChildA, childB: ChildB, childC: ChildC, shared: SharedThing, userDefaults: UserDefaults) {
self.childA = childA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
import SafeDI

@Instantiable
public final class SharedThing: Instantiable {
public final class SharedThing: Instantiable, Sendable {
public init() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Foundation
import SafeDI

@Instantiable
extension UserDefaults: Instantiable {
extension UserDefaults: @retroactive Instantiable {
public static func instantiate() -> UserDefaults {
.standard
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -318,6 +319,7 @@
MTL_FAST_MATH = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand Down Expand Up @@ -353,7 +355,6 @@
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -390,7 +391,6 @@
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
Loading

0 comments on commit 435393c

Please sign in to comment.