|  | 
|  | 1 | +// swift-tools-version: 5.8 | 
|  | 2 | + | 
|  | 3 | +import PackageDescription | 
|  | 4 | +import CompilerPluginSupport | 
|  | 5 | + | 
|  | 6 | +// Availability Macros | 
|  | 7 | + | 
|  | 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 | +] | 
|  | 12 | + | 
|  | 13 | +let package = Package( | 
|  | 14 | +  name: "swift-async-algorithms", | 
|  | 15 | +  products: [ | 
|  | 16 | +    .library(name: "AsyncAlgorithms", targets: ["AsyncAlgorithms"]) | 
|  | 17 | +  ], | 
|  | 18 | +  targets: [ | 
|  | 19 | +    .target( | 
|  | 20 | +      name: "AsyncAlgorithms", | 
|  | 21 | +      dependencies: [ | 
|  | 22 | +        .product(name: "OrderedCollections", package: "swift-collections"), | 
|  | 23 | +        .product(name: "DequeModule", package: "swift-collections"), | 
|  | 24 | +      ], | 
|  | 25 | +      swiftSettings: availabilityMacros + [ | 
|  | 26 | +        .enableExperimentalFeature("StrictConcurrency=complete") | 
|  | 27 | +      ] | 
|  | 28 | +    ), | 
|  | 29 | +    .target( | 
|  | 30 | +      name: "AsyncSequenceValidation", | 
|  | 31 | +      dependencies: ["_CAsyncSequenceValidationSupport", "AsyncAlgorithms"], | 
|  | 32 | +      swiftSettings: availabilityMacros + [ | 
|  | 33 | +        .enableExperimentalFeature("StrictConcurrency=complete") | 
|  | 34 | +      ] | 
|  | 35 | +    ), | 
|  | 36 | +    .systemLibrary(name: "_CAsyncSequenceValidationSupport"), | 
|  | 37 | +    .target( | 
|  | 38 | +      name: "AsyncAlgorithms_XCTest", | 
|  | 39 | +      dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation"], | 
|  | 40 | +      swiftSettings: availabilityMacros + [ | 
|  | 41 | +        .enableExperimentalFeature("StrictConcurrency=complete") | 
|  | 42 | +      ] | 
|  | 43 | +    ), | 
|  | 44 | +    .testTarget( | 
|  | 45 | +      name: "AsyncAlgorithmsTests", | 
|  | 46 | +      dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation", "AsyncAlgorithms_XCTest"], | 
|  | 47 | +      swiftSettings: availabilityMacros + [ | 
|  | 48 | +        .enableExperimentalFeature("StrictConcurrency=complete") | 
|  | 49 | +      ] | 
|  | 50 | +    ), | 
|  | 51 | +  ] | 
|  | 52 | +) | 
|  | 53 | + | 
|  | 54 | +if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { | 
|  | 55 | +  package.dependencies += [ | 
|  | 56 | +    .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0"), | 
|  | 57 | +  ] | 
|  | 58 | +} else { | 
|  | 59 | +  package.dependencies += [ | 
|  | 60 | +    .package(path: "../swift-collections") | 
|  | 61 | +  ] | 
|  | 62 | +} | 
0 commit comments