Skip to content

Commit 4322be7

Browse files
committed
Simplify the version definitions and add a new definition for 1.1 (#359)
1 parent 954eb99 commit 4322be7

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

Package.swift

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,11 @@ import PackageDescription
44
import CompilerPluginSupport
55

66
// Availability Macros
7-
let availabilityTags = [Availability("AsyncAlgorithms")]
8-
let versionNumbers = ["1.0"]
97

10-
// Availability Macro Utilities
11-
enum OSAvailability: String {
12-
// This should match the package's deployment target
13-
case initialIntroduction = "macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0"
14-
case pending = "macOS 9999, iOS 9999, tvOS 9999, watchOS 9999"
15-
// Use 10000 for future availability to avoid compiler magic around
16-
// the 9999 version number but ensure it is greater than 9999
17-
case future = "macOS 10000, iOS 10000, tvOS 10000, watchOS 10000"
18-
}
19-
20-
struct Availability {
21-
let name: String
22-
let osAvailability: OSAvailability
23-
24-
init(_ name: String, availability: OSAvailability = .initialIntroduction) {
25-
self.name = name
26-
self.osAvailability = availability
27-
}
28-
}
29-
30-
let availabilityMacros: [SwiftSetting] = versionNumbers.flatMap { version in
31-
availabilityTags.map {
32-
.enableExperimentalFeature("AvailabilityMacro=\($0.name) \(version):\($0.osAvailability.rawValue)")
33-
}
34-
}
8+
let availabilityMacros: [SwiftSetting] = [
9+
.enableExperimentalFeature("AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0"),
10+
.enableExperimentalFeature("AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"),
11+
]
3512

3613
let package = Package(
3714
name: "swift-async-algorithms",

0 commit comments

Comments
 (0)