diff --git a/Package.swift b/Package.swift index d6768c9..63435a0 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.10 +// swift-tools-version: 5.9 import PackageDescription @@ -14,7 +14,7 @@ let package = Package( targets: [ .target( name: "Deadline", - swiftSettings: [.enableUpcomingFeature("StrictConcurrency")] + swiftSettings: [.enableExperimentalFeature("StrictConcurrency")] ), .testTarget( name: "DeadlineTests", @@ -22,7 +22,7 @@ let package = Package( "Deadline", .product(name: "Clocks", package: "swift-clocks") ], - swiftSettings: [.enableUpcomingFeature("StrictConcurrency")] + swiftSettings: [.enableExperimentalFeature("StrictConcurrency")] ), ] ) diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift new file mode 100644 index 0000000..2e4e0c0 --- /dev/null +++ b/Package@swift-5.8.swift @@ -0,0 +1,26 @@ +// swift-tools-version: 5.8 + +import PackageDescription + +let package = Package( + name: "swift-concurrency-deadline", + platforms: [.iOS(.v16), .macOS(.v13), .macCatalyst(.v16), .tvOS(.v16), .watchOS(.v9)], + products: [ + .library(name: "Deadline", targets: ["Deadline"]), + ], + dependencies: [ + .package(url: "https://github.com/pointfreeco/swift-clocks", from: "1.0.0") + ], + targets: [ + .target( + name: "Deadline" + ), + .testTarget( + name: "DeadlineTests", + dependencies: [ + "Deadline", + .product(name: "Clocks", package: "swift-clocks") + ] + ), + ] +) diff --git a/Package@swift-6.0.swift b/Package@swift-6.0.swift new file mode 100644 index 0000000..9e6fd6a --- /dev/null +++ b/Package@swift-6.0.swift @@ -0,0 +1,27 @@ +// swift-tools-version: 6.0 + +import PackageDescription + +let package = Package( + name: "swift-concurrency-deadline", + platforms: [.iOS(.v16), .macOS(.v13), .macCatalyst(.v16), .tvOS(.v16), .watchOS(.v9), .visionOS(.v1)], + products: [ + .library(name: "Deadline", targets: ["Deadline"]), + ], + dependencies: [ + .package(url: "https://github.com/pointfreeco/swift-clocks", from: "1.0.0") + ], + targets: [ + .target( + name: "Deadline", + ), + .testTarget( + name: "DeadlineTests", + dependencies: [ + "Deadline", + .product(name: "Clocks", package: "swift-clocks") + ] + ) + ], + swiftLanguageModes: [.v6] +) diff --git a/Sources/Deadline/Deadline.swift b/Sources/Deadline/Deadline.swift index c58f075..e27e0c4 100644 --- a/Sources/Deadline/Deadline.swift +++ b/Sources/Deadline/Deadline.swift @@ -1,4 +1,4 @@ -enum DeadlineState { +enum DeadlineState: Sendable where T: Sendable { case result(Result) case sleepWasCancelled case deadlineExceeded