Skip to content

Commit bf93045

Browse files
authored
Adopt Swift 6. Drop support for Xcode 15 and below (#39)
* Adopt Swift 6. Drop support for Xcode 15 and below * Update README * Simplify MainActor * Simplify ActorQueue
1 parent 66f3d52 commit bf93045

File tree

11 files changed

+94
-254
lines changed

11 files changed

+94
-254
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,40 @@ on:
99
jobs:
1010
pod-lint:
1111
name: Pod Lint
12-
runs-on: ubuntu-latest
12+
runs-on: macos-14
1313
steps:
14-
- uses: ruby/setup-ruby@v1
15-
with:
16-
ruby-version: '3.3.1'
1714
- name: Checkout Repo
1815
uses: actions/checkout@v4
19-
- name: Setup Swift Environment
20-
uses: swift-actions/setup-swift@v2
16+
- uses: ruby/setup-ruby@v1
2117
with:
22-
swift-version: 5.9
23-
- name: Bundle Install
24-
run: bundle install
18+
ruby-version: '3.3.5'
19+
bundler-cache: true
20+
- name: Select Xcode Version
21+
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
2522
- name: Lint Podspec
26-
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=5.9
27-
spm-15:
28-
name: Build Xcode 15
23+
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=6.0
24+
spm-16:
25+
name: Build Xcode 16
2926
runs-on: macos-14
3027
strategy:
3128
matrix:
3229
platforms: [
33-
'iOS_17,watchOS_10',
34-
'macOS_14,tvOS_17',
35-
'visionOS_1'
30+
'iOS_18,watchOS_11',
31+
'macOS_15,tvOS_18',
32+
'visionOS_2'
3633
]
3734
fail-fast: false
3835
steps:
39-
- uses: ruby/setup-ruby@v1
40-
with:
41-
ruby-version: '3.3.1'
4236
- name: Checkout Repo
4337
uses: actions/checkout@v4
44-
- name: Bundle Install
45-
run: bundle install
38+
- uses: ruby/setup-ruby@v1
39+
with:
40+
ruby-version: '3.3.5'
41+
bundler-cache: true
4642
- name: Select Xcode Version
47-
run: sudo xcode-select --switch /Applications/Xcode_15.4.app/Contents/Developer
43+
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
4844
- name: Download visionOS
49-
if: matrix.platforms == 'visionOS_1'
45+
if: matrix.platforms == 'visionOS_2'
5046
run: |
5147
sudo xcodebuild -runFirstLaunch
5248
sudo xcrun simctl list
@@ -61,31 +57,27 @@ jobs:
6157
uses: codecov/codecov-action@v4
6258
with:
6359
token: ${{ secrets.CODECOV_TOKEN }}
64-
spm-15-swift:
65-
name: Swift Build Xcode 15
60+
spm-16-swift:
61+
name: Swift Build Xcode 16
6662
runs-on: macos-14
6763
steps:
68-
- uses: ruby/setup-ruby@v1
69-
with:
70-
ruby-version: '3.3.1'
7164
- name: Checkout Repo
7265
uses: actions/checkout@v4
73-
- name: Bundle Install
74-
run: bundle install
66+
- uses: ruby/setup-ruby@v1
67+
with:
68+
ruby-version: '3.3.5'
69+
bundler-cache: true
7570
- name: Select Xcode Version
76-
run: sudo xcode-select --switch /Applications/Xcode_15.4.app/Contents/Developer
71+
run: sudo xcode-select --switch /Applications/Xcode_16.app/Contents/Developer
7772
- name: Build and Test Framework
7873
run: xcrun swift test -c release -Xswiftc -enable-testing
7974
linux:
8075
name: "Build and Test on Linux"
81-
runs-on: ubuntu-latest
76+
runs-on: ubuntu-24.04
77+
container: swift:6.0
8278
steps:
8379
- name: Checkout Repo
8480
uses: actions/checkout@v4
85-
- name: Setup Swift Environment
86-
uses: swift-actions/setup-swift@v2
87-
with:
88-
swift-version: 5.9
8981
- name: Build and Test Framework
9082
run: swift test -c release --enable-code-coverage -Xswiftc -enable-testing
9183
- name: Prepare Coverage Reports

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.1
1+
3.3.5

AsyncQueue.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22
s.name = 'AsyncQueue'
3-
s.version = '0.5.2'
3+
s.version = '0.6.0'
44
s.license = 'MIT'
55
s.summary = 'A queue that enables ordered sending of events from synchronous to asynchronous code.'
66
s.homepage = 'https://github.com/dfed/swift-async-queue'
77
s.authors = 'Dan Federman'
88
s.source = { :git => 'https://github.com/dfed/swift-async-queue.git', :tag => s.version }
9-
s.swift_version = '5.9'
9+
s.swift_version = '6.0'
1010
s.source_files = 'Sources/**/*.{swift}'
1111
s.ios.deployment_target = '13.0'
1212
s.tvos.deployment_target = '13.0'

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ruby '3.3.1'
1+
ruby '3.3.5'
22

33
source 'https://rubygems.org'
44

Gemfile.lock

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GEM
55
base64
66
nkf
77
rexml
8-
activesupport (7.2.0)
8+
activesupport (7.2.1)
99
base64
1010
bigdecimal
1111
concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -74,22 +74,20 @@ GEM
7474
fuzzy_match (2.0.4)
7575
gh_inspector (1.1.3)
7676
httpclient (2.8.3)
77-
i18n (1.14.5)
77+
i18n (1.14.6)
7878
concurrent-ruby (~> 1.0)
7979
json (2.7.2)
80-
logger (1.6.0)
80+
logger (1.6.1)
8181
minitest (5.25.1)
8282
molinillo (0.8.0)
8383
nanaimo (0.3.0)
8484
nap (1.1.0)
8585
netrc (0.11.0)
8686
nkf (0.2.0)
8787
public_suffix (4.0.7)
88-
rexml (3.3.6)
89-
strscan
88+
rexml (3.3.7)
9089
ruby-macho (2.5.1)
9190
securerandom (0.3.1)
92-
strscan (3.1.0)
9391
typhoeus (1.4.1)
9492
ethon (>= 0.9.0)
9593
tzinfo (2.0.6)
@@ -109,7 +107,7 @@ DEPENDENCIES
109107
cocoapods (~> 1.15.0)
110108

111109
RUBY VERSION
112-
ruby 3.3.1p55
110+
ruby 3.3.5p100
113111

114112
BUNDLED WITH
115-
2.5.9
113+
2.5.16

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -23,13 +23,13 @@ let package = Package(
2323
name: "AsyncQueue",
2424
dependencies: [],
2525
swiftSettings: [
26-
.enableUpcomingFeature("StrictConcurrency")
26+
.swiftLanguageMode(.v6),
2727
]),
2828
.testTarget(
2929
name: "AsyncQueueTests",
3030
dependencies: ["AsyncQueue"],
3131
swiftSettings: [
32-
.enableUpcomingFeature("StrictConcurrency")
32+
.swiftLanguageMode(.v6),
3333
]),
3434
]
3535
)

Package@swift-6.0.swift

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ A library of queues that enable sending ordered tasks from synchronous to asynch
99

1010
## Task Ordering and Swift Concurrency
1111

12-
Tasks sent from a synchronous context to an asynchronous context in Swift Concurrency prior to Swift 6 are inherently unordered. Consider the following test:
12+
Tasks sent from a synchronous context to an asynchronous context in Swift Concurrency are inherently unordered. Consider the following test:
1313

1414
```swift
15-
@MainActor
16-
func testMainActorTaskOrdering() async {
15+
func testActorTaskOrdering() async {
1716
actor Counter {
1817
func incrementAndAssertCountEquals(_ expectedCount: Int) {
1918
count += 1
@@ -167,12 +166,12 @@ func testMainActorQueueOrdering() async {
167166

168167
## Requirements
169168

170-
* Xcode 15.0 or later.
169+
* Xcode 16.0 or later.
171170
* iOS 13 or later.
172171
* tvOS 13 or later.
173172
* watchOS 6 or later.
174173
* macOS 10.15 or later.
175-
* Swift 5.9 or later.
174+
* Swift 5.10 or later.
176175

177176
## Installation
178177

@@ -182,7 +181,7 @@ To install swift-async-queue in your project with [Swift Package Manager](https:
182181

183182
```swift
184183
dependencies: [
185-
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.5.0"),
184+
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.6.0"),
186185
]
187186
```
188187

@@ -192,7 +191,7 @@ To install swift-async-queue in your project with [CocoaPods](http://cocoapods.o
192191

193192
```
194193
platform :ios, '13.0'
195-
pod 'AsyncQueue', '~> 0.5.0'
194+
pod 'AsyncQueue', '~> 0.6.0'
196195
```
197196

198197
## Contributing

0 commit comments

Comments
 (0)