Skip to content

Commit 0b6dbe1

Browse files
authored
Adopt Swift 5.9 (#22)
1 parent 9f2311f commit 0b6dbe1

File tree

9 files changed

+44
-83
lines changed

9 files changed

+44
-83
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,9 @@ jobs:
1616
- name: Bundle Install
1717
run: bundle install
1818
- name: Select Xcode Version
19-
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
19+
run: sudo xcode-select --switch /Applications/Xcode_15.0.1.app/Contents/Developer
2020
- name: Lint Podspec
21-
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=5.8
22-
spm-14:
23-
name: Build Xcode 14
24-
runs-on: macos-13
25-
strategy:
26-
matrix:
27-
platforms: [
28-
'iOS_16,watchOS_9',
29-
'macOS_13,tvOS_16',
30-
]
31-
fail-fast: false
32-
steps:
33-
- name: Checkout Repo
34-
uses: actions/checkout@v3
35-
- name: Bundle Install
36-
run: bundle install
37-
- name: Select Xcode Version
38-
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
39-
- name: Build and Test Framework
40-
run: Scripts/build.swift ${{ matrix.platforms }}
41-
- name: Prepare Coverage Reports
42-
run: ./Scripts/prepare-coverage-reports.sh
43-
- name: Upload Coverage Reports
44-
if: success()
45-
uses: codecov/codecov-action@v3
46-
spm-14-swift:
47-
name: Swift Build Xcode 14
48-
runs-on: macos-13
49-
steps:
50-
- name: Checkout Repo
51-
uses: actions/checkout@v3
52-
- name: Bundle Install
53-
run: bundle install
54-
- name: Select Xcode Version
55-
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
56-
- name: Build and Test Framework
57-
run: xcrun swift test -c release -Xswiftc -enable-testing
21+
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=5.9
5822
spm-15:
5923
name: Build Xcode 15
6024
runs-on: macos-13
@@ -71,7 +35,7 @@ jobs:
7135
- name: Bundle Install
7236
run: bundle install
7337
- name: Select Xcode Version
74-
run: sudo xcode-select --switch /Applications/Xcode_15.0.app/Contents/Developer
38+
run: sudo xcode-select --switch /Applications/Xcode_15.0.1.app/Contents/Developer
7539
- name: Build and Test Framework
7640
run: Scripts/build.swift ${{ matrix.platforms }}
7741
- name: Prepare Coverage Reports
@@ -88,6 +52,6 @@ jobs:
8852
- name: Bundle Install
8953
run: bundle install
9054
- name: Select Xcode Version
91-
run: sudo xcode-select --switch /Applications/Xcode_15.0.app/Contents/Developer
55+
run: sudo xcode-select --switch /Applications/Xcode_15.0.1.app/Contents/Developer
9256
- name: Build and Test Framework
9357
run: xcrun swift test -c release -Xswiftc -enable-testing

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.4.0'
3+
s.version = '0.5.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.8'
9+
s.swift_version = '5.9'
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
@@ -2,4 +2,4 @@ ruby '3.0.6'
22

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

5-
gem 'cocoapods', '~> 1.12.0'
5+
gem 'cocoapods', '~> 1.14.0'

Gemfile.lock

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,31 @@ GEM
33
specs:
44
CFPropertyList (3.0.6)
55
rexml
6-
activesupport (7.0.7.2)
6+
activesupport (7.1.2)
7+
base64
8+
bigdecimal
79
concurrent-ruby (~> 1.0, >= 1.0.2)
10+
connection_pool (>= 2.2.5)
11+
drb
812
i18n (>= 1.6, < 2)
913
minitest (>= 5.1)
14+
mutex_m
1015
tzinfo (~> 2.0)
11-
addressable (2.8.3)
16+
addressable (2.8.5)
1217
public_suffix (>= 2.0.2, < 6.0)
1318
algoliasearch (1.27.5)
1419
httpclient (~> 2.8, >= 2.8.3)
1520
json (>= 1.5.1)
1621
atomos (0.1.3)
22+
base64 (0.2.0)
23+
bigdecimal (3.1.4)
1724
claide (1.1.0)
18-
cocoapods (1.12.0)
25+
cocoapods (1.14.3)
1926
addressable (~> 2.8)
2027
claide (>= 1.0.2, < 2.0)
21-
cocoapods-core (= 1.12.0)
28+
cocoapods-core (= 1.14.3)
2229
cocoapods-deintegrate (>= 1.0.3, < 2.0)
23-
cocoapods-downloader (>= 1.6.0, < 2.0)
30+
cocoapods-downloader (>= 2.1, < 3.0)
2431
cocoapods-plugins (>= 1.0.0, < 2.0)
2532
cocoapods-search (>= 1.0.0, < 2.0)
2633
cocoapods-trunk (>= 1.6.0, < 2.0)
@@ -32,8 +39,8 @@ GEM
3239
molinillo (~> 0.8.0)
3340
nap (~> 1.0)
3441
ruby-macho (>= 2.3.0, < 3.0)
35-
xcodeproj (>= 1.21.0, < 2.0)
36-
cocoapods-core (1.12.0)
42+
xcodeproj (>= 1.23.0, < 2.0)
43+
cocoapods-core (1.14.3)
3744
activesupport (>= 5.0, < 8)
3845
addressable (~> 2.8)
3946
algoliasearch (~> 1.0)
@@ -44,7 +51,7 @@ GEM
4451
public_suffix (~> 4.0)
4552
typhoeus (~> 1.0)
4653
cocoapods-deintegrate (1.0.5)
47-
cocoapods-downloader (1.6.3)
54+
cocoapods-downloader (2.1)
4855
cocoapods-plugins (1.0.0)
4956
nap
5057
cocoapods-search (1.0.1)
@@ -54,30 +61,35 @@ GEM
5461
cocoapods-try (1.2.0)
5562
colored2 (3.1.2)
5663
concurrent-ruby (1.2.2)
64+
connection_pool (2.4.1)
65+
drb (2.2.0)
66+
ruby2_keywords
5767
escape (0.0.4)
5868
ethon (0.16.0)
5969
ffi (>= 1.15.0)
60-
ffi (1.15.5)
70+
ffi (1.16.3)
6171
fourflusher (2.3.1)
6272
fuzzy_match (2.0.4)
6373
gh_inspector (1.1.3)
6474
httpclient (2.8.3)
6575
i18n (1.14.1)
6676
concurrent-ruby (~> 1.0)
6777
json (2.6.3)
68-
minitest (5.19.0)
78+
minitest (5.20.0)
6979
molinillo (0.8.0)
80+
mutex_m (0.2.0)
7081
nanaimo (0.3.0)
7182
nap (1.1.0)
7283
netrc (0.11.0)
7384
public_suffix (4.0.7)
74-
rexml (3.2.5)
85+
rexml (3.2.6)
7586
ruby-macho (2.5.1)
76-
typhoeus (1.4.0)
87+
ruby2_keywords (0.0.5)
88+
typhoeus (1.4.1)
7789
ethon (>= 0.9.0)
7890
tzinfo (2.0.6)
7991
concurrent-ruby (~> 1.0)
80-
xcodeproj (1.22.0)
92+
xcodeproj (1.23.0)
8193
CFPropertyList (>= 2.3.3, < 4.0)
8294
atomos (~> 0.1.3)
8395
claide (>= 1.0.2, < 2.0)
@@ -89,7 +101,7 @@ PLATFORMS
89101
ruby
90102

91103
DEPENDENCIES
92-
cocoapods (~> 1.12.0)
104+
cocoapods (~> 1.14.0)
93105

94106
RUBY VERSION
95107
ruby 3.0.6p216

Package.swift

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

44
import PackageDescription

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ func testMainActorQueueOrdering() async {
168168

169169
## Requirements
170170

171-
* Xcode 14.3 or later.
171+
* Xcode 15.0 or later.
172172
* iOS 13 or later.
173173
* tvOS 13 or later.
174174
* watchOS 6 or later.
175175
* macOS 10.15 or later.
176-
* Swift 5.8 or later.
176+
* Swift 5.9 or later.
177177

178178
## Installation
179179

@@ -183,7 +183,7 @@ To install swift-async-queue in your iOS project with [Swift Package Manager](ht
183183

184184
```swift
185185
dependencies: [
186-
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.4.0"),
186+
.package(url: "https://github.com/dfed/swift-async-queue", from: "0.5.0"),
187187
]
188188
```
189189

@@ -193,7 +193,7 @@ To install swift-async-queue in your iOS project with [CocoaPods](http://cocoapo
193193

194194
```
195195
platform :ios, '13.0'
196-
pod 'AsyncQueue', '~> 0.4.0'
196+
pod 'AsyncQueue', '~> 0.5.0'
197197
```
198198

199199
## Contributing

Sources/AsyncQueue/ActorQueue.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,8 @@ public final class ActorQueue<ActorType: Actor>: @unchecked Sendable {
5757

5858
/// Instantiates an actor queue.
5959
public init() {
60-
var capturedTaskStreamContinuation: AsyncStream<ActorTask>.Continuation? = nil
61-
let taskStream = AsyncStream<ActorTask> { continuation in
62-
capturedTaskStreamContinuation = continuation
63-
}
64-
// Continuation will be captured during stream creation, so it is safe to force unwrap here.
65-
// If this force-unwrap fails, something is fundamentally broken in the Swift runtime.
66-
taskStreamContinuation = capturedTaskStreamContinuation!
60+
let (taskStream, taskStreamContinuation) = AsyncStream<ActorTask>.makeStream()
61+
self.taskStreamContinuation = taskStreamContinuation
6762

6863
Task.detached {
6964
for await actorTask in taskStream {

Sources/AsyncQueue/FIFOQueue.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,8 @@ public final class FIFOQueue: Sendable {
3030
/// Instantiates a FIFO queue.
3131
/// - Parameter priority: The baseline priority of the tasks added to the asynchronous queue.
3232
public init(priority: TaskPriority? = nil) {
33-
var capturedTaskStreamContinuation: AsyncStream<@Sendable () async -> Void>.Continuation? = nil
34-
let taskStream = AsyncStream<@Sendable () async -> Void> { continuation in
35-
capturedTaskStreamContinuation = continuation
36-
}
37-
// Continuation will be captured during stream creation, so it is safe to force unwrap here.
38-
// If this force-unwrap fails, something is fundamentally broken in the Swift runtime.
39-
taskStreamContinuation = capturedTaskStreamContinuation!
33+
let (taskStream, taskStreamContinuation) = AsyncStream<@Sendable () async -> Void>.makeStream()
34+
self.taskStreamContinuation = taskStreamContinuation
4035

4136
Task.detached(priority: priority) {
4237
for await task in taskStream {

Sources/AsyncQueue/MainActorQueue.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,8 @@ public final class MainActorQueue: Sendable {
3131

3232
/// Instantiates a main actor queue.
3333
init() {
34-
var capturedTaskStreamContinuation: AsyncStream<@Sendable @MainActor () async -> Void>.Continuation? = nil
35-
let taskStream = AsyncStream<@Sendable @MainActor () async -> Void> { continuation in
36-
capturedTaskStreamContinuation = continuation
37-
}
38-
// Continuation will be captured during stream creation, so it is safe to force unwrap here.
39-
// If this force-unwrap fails, something is fundamentally broken in the Swift runtime.
40-
taskStreamContinuation = capturedTaskStreamContinuation!
34+
let (taskStream, taskStreamContinuation) = AsyncStream<@Sendable @MainActor () async -> Void>.makeStream()
35+
self.taskStreamContinuation = taskStreamContinuation
4136

4237
Task.detached { @MainActor in
4338
for await task in taskStream {

0 commit comments

Comments
 (0)