mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-22 04:10:40 +00:00
* rename the map error proposal to have a specific number * rename the flatMapLatest proposal to have a specific numbering * Update availability markers for flatmapLatest * Cleanup formatting pass for FlatMapLatest * Remove stray extra single quote * Add a fallback for older versions of swift for the next method on flatMapLatest
105 lines
2.9 KiB
Swift
105 lines
2.9 KiB
Swift
// swift-tools-version: 5.8
|
|
|
|
import PackageDescription
|
|
import CompilerPluginSupport
|
|
|
|
// Availability Macros
|
|
|
|
let availabilityMacros: [SwiftSetting] = [
|
|
.enableExperimentalFeature(
|
|
"AvailabilityMacro=AsyncAlgorithms 1.0:macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0"
|
|
),
|
|
.enableExperimentalFeature(
|
|
"AvailabilityMacro=AsyncAlgorithms 1.1:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"
|
|
),
|
|
.enableExperimentalFeature(
|
|
"AvailabilityMacro=AsyncAlgorithms 1.2:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"
|
|
),
|
|
.enableExperimentalFeature(
|
|
"AvailabilityMacro=AsyncAlgorithms 1.3:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"
|
|
),
|
|
]
|
|
|
|
let package = Package(
|
|
name: "swift-async-algorithms",
|
|
products: [
|
|
.library(name: "AsyncAlgorithms", targets: ["AsyncAlgorithms"])
|
|
],
|
|
targets: [
|
|
.target(
|
|
name: "AsyncAlgorithms",
|
|
dependencies: [
|
|
.product(name: "OrderedCollections", package: "swift-collections"),
|
|
.product(name: "DequeModule", package: "swift-collections"),
|
|
],
|
|
swiftSettings: availabilityMacros + [
|
|
.enableExperimentalFeature("StrictConcurrency=complete")
|
|
]
|
|
),
|
|
.target(
|
|
name: "AsyncSequenceValidation",
|
|
dependencies: ["_CAsyncSequenceValidationSupport", "AsyncAlgorithms"],
|
|
swiftSettings: availabilityMacros + [
|
|
.enableExperimentalFeature("StrictConcurrency=complete")
|
|
]
|
|
),
|
|
.systemLibrary(name: "_CAsyncSequenceValidationSupport"),
|
|
.target(
|
|
name: "AsyncAlgorithms_XCTest",
|
|
dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation"],
|
|
swiftSettings: availabilityMacros + [
|
|
.enableExperimentalFeature("StrictConcurrency=complete")
|
|
]
|
|
),
|
|
.testTarget(
|
|
name: "AsyncAlgorithmsTests",
|
|
dependencies: [
|
|
.target(name: "AsyncAlgorithms"),
|
|
.target(
|
|
name: "AsyncSequenceValidation",
|
|
condition: .when(platforms: [
|
|
.macOS,
|
|
.iOS,
|
|
.tvOS,
|
|
.watchOS,
|
|
.visionOS,
|
|
.macCatalyst,
|
|
.android,
|
|
.linux,
|
|
.openbsd,
|
|
.wasi,
|
|
])
|
|
),
|
|
.target(
|
|
name: "AsyncAlgorithms_XCTest",
|
|
condition: .when(platforms: [
|
|
.macOS,
|
|
.iOS,
|
|
.tvOS,
|
|
.watchOS,
|
|
.visionOS,
|
|
.macCatalyst,
|
|
.android,
|
|
.linux,
|
|
.openbsd,
|
|
.wasi,
|
|
])
|
|
),
|
|
],
|
|
swiftSettings: availabilityMacros + [
|
|
.enableExperimentalFeature("StrictConcurrency=complete")
|
|
]
|
|
),
|
|
]
|
|
)
|
|
|
|
if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
|
|
package.dependencies += [
|
|
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0")
|
|
]
|
|
} else {
|
|
package.dependencies += [
|
|
.package(path: "../swift-collections")
|
|
]
|
|
}
|