Skip to content

Commit

Permalink
Depend on ConcurrencyExtras (#21)
Browse files Browse the repository at this point in the history
We use `Task.megaYield` to make Swift concurrency more reliable, so
let's bring it in from a shared library.
  • Loading branch information
stephencelis authored Jul 17, 2023
1 parent 2320fda commit 0fbaebf
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 24 deletions.
13 changes: 11 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
"version" : "1.0.3"
}
},
{
"identity" : "swift-concurrency-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
"state" : {
"revision" : "ecb065a41bbdd7f64ab2695ffc755ed37c9ff4dc",
"version" : "0.1.0"
}
},
{
"identity" : "swift-docc-plugin",
"kind" : "remoteSourceControl",
Expand All @@ -32,8 +41,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "f821dcbac7cb6913f8e0d1a80496d0ba0199fa81",
"version" : "0.3.0"
"revision" : "4af50b38daf0037cfbab15514a241224c3f62f98",
"version" : "0.8.5"
}
}
],
Expand Down
6 changes: 4 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "0.3.0"),
.package(url: "https://github.com/apple/swift-async-algorithms", revision: "cf70e78"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "0.1.0"),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "0.8.0"),
],
targets: [
.target(
name: "Clocks",
dependencies: [
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay")
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"),
]
),
.testTarget(
Expand Down
1 change: 1 addition & 0 deletions Sources/Clocks/ImmediateClock.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
import ConcurrencyExtras
import Foundation

/// A clock that does not suspend when sleeping.
Expand Down
19 changes: 0 additions & 19 deletions Sources/Clocks/Internal/Yield.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/Clocks/Shims.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst)) && swift(<5.9)
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
extension Clock {
/// Suspends for the given duration.
Expand Down
1 change: 1 addition & 0 deletions Sources/Clocks/TestClock.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
import ConcurrencyExtras
import Foundation
import XCTestDynamicOverlay

Expand Down
1 change: 1 addition & 0 deletions Sources/Clocks/UnimplementedClock.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
import ConcurrencyExtras
import Foundation
import XCTestDynamicOverlay

Expand Down

0 comments on commit 0fbaebf

Please sign in to comment.