|
| 1 | +// swift-tools-version:6.0 |
| 2 | + |
| 3 | +import CompilerPluginSupport |
| 4 | +import PackageDescription |
| 5 | + |
| 6 | +let package = Package( |
| 7 | + name: "swift-composable-architecture", |
| 8 | + platforms: [ |
| 9 | + .iOS(.v13), |
| 10 | + .macOS(.v10_15), |
| 11 | + .tvOS(.v13), |
| 12 | + .watchOS(.v6), |
| 13 | + ], |
| 14 | + products: [ |
| 15 | + .library( |
| 16 | + name: "ComposableArchitecture", |
| 17 | + targets: ["ComposableArchitecture"] |
| 18 | + ) |
| 19 | + ], |
| 20 | + dependencies: [ |
| 21 | + .package(url: "https://github.com/apple/swift-collections", from: "1.1.0"), |
| 22 | + .package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"), |
| 23 | + .package(url: "https://github.com/pointfreeco/combine-schedulers", from: "1.0.2"), |
| 24 | + .package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.4"), |
| 25 | + .package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.1.0"), |
| 26 | + .package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.2"), |
| 27 | + .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.3.5"), |
| 28 | + .package(url: "https://github.com/pointfreeco/swift-identified-collections", from: "1.1.0"), |
| 29 | + .package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"), |
| 30 | + .package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.1.0"), |
| 31 | + .package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"), |
| 32 | + .package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.2.2"), |
| 33 | + .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"), |
| 34 | + .package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"601.0.0-prerelease"), |
| 35 | + ], |
| 36 | + targets: [ |
| 37 | + .target( |
| 38 | + name: "ComposableArchitecture", |
| 39 | + dependencies: [ |
| 40 | + "ComposableArchitectureMacros", |
| 41 | + .product(name: "CasePaths", package: "swift-case-paths"), |
| 42 | + .product(name: "CombineSchedulers", package: "combine-schedulers"), |
| 43 | + .product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"), |
| 44 | + .product(name: "CustomDump", package: "swift-custom-dump"), |
| 45 | + .product(name: "Dependencies", package: "swift-dependencies"), |
| 46 | + .product(name: "DependenciesMacros", package: "swift-dependencies"), |
| 47 | + .product(name: "IdentifiedCollections", package: "swift-identified-collections"), |
| 48 | + .product(name: "IssueReporting", package: "xctest-dynamic-overlay"), |
| 49 | + .product(name: "OrderedCollections", package: "swift-collections"), |
| 50 | + .product(name: "Perception", package: "swift-perception"), |
| 51 | + .product(name: "SwiftUINavigation", package: "swift-navigation"), |
| 52 | + .product(name: "UIKitNavigation", package: "swift-navigation"), |
| 53 | + ], |
| 54 | + resources: [ |
| 55 | + .process("Resources/PrivacyInfo.xcprivacy") |
| 56 | + ] |
| 57 | + ), |
| 58 | + .testTarget( |
| 59 | + name: "ComposableArchitectureTests", |
| 60 | + dependencies: [ |
| 61 | + "ComposableArchitecture", |
| 62 | + .product(name: "IssueReportingTestSupport", package: "xctest-dynamic-overlay"), |
| 63 | + ] |
| 64 | + ), |
| 65 | + .macro( |
| 66 | + name: "ComposableArchitectureMacros", |
| 67 | + dependencies: [ |
| 68 | + .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), |
| 69 | + .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), |
| 70 | + ] |
| 71 | + ), |
| 72 | + .testTarget( |
| 73 | + name: "ComposableArchitectureMacrosTests", |
| 74 | + dependencies: [ |
| 75 | + "ComposableArchitectureMacros", |
| 76 | + .product(name: "MacroTesting", package: "swift-macro-testing"), |
| 77 | + ] |
| 78 | + ), |
| 79 | + .executableTarget( |
| 80 | + name: "swift-composable-architecture-benchmark", |
| 81 | + dependencies: [ |
| 82 | + "ComposableArchitecture", |
| 83 | + .product(name: "Benchmark", package: "swift-benchmark"), |
| 84 | + ] |
| 85 | + ), |
| 86 | + ], |
| 87 | + swiftLanguageModes: [.v6] |
| 88 | +) |
| 89 | + |
| 90 | +for target in package.targets where target.type == .system || target.type == .test { |
| 91 | + target.swiftSettings = target.swiftSettings ?? [] |
| 92 | + target.swiftSettings?.append(contentsOf: [ |
| 93 | + .swiftLanguageMode(.v5), |
| 94 | + .enableExperimentalFeature("StrictConcurrency"), |
| 95 | + .enableUpcomingFeature("InferSendableFromCaptures") |
| 96 | + ]) |
| 97 | +} |
0 commit comments