|
| 1 | +// swift-tools-version:5.4 |
| 2 | +//===----------------------------------------------------------------------===// |
| 3 | +// |
| 4 | +// This source file is part of the SwiftNIO open source project |
| 5 | +// |
| 6 | +// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors |
| 7 | +// Licensed under Apache License v2.0 |
| 8 | +// |
| 9 | +// See LICENSE.txt for license information |
| 10 | +// See CONTRIBUTORS.txt for the list of SwiftNIO project authors |
| 11 | +// |
| 12 | +// SPDX-License-Identifier: Apache-2.0 |
| 13 | +// |
| 14 | +//===----------------------------------------------------------------------===// |
| 15 | + |
| 16 | +import PackageDescription |
| 17 | + |
| 18 | +let swiftAtomics: PackageDescription.Target.Dependency = .product(name: "Atomics", package: "swift-atomics") |
| 19 | +let swiftCollections: PackageDescription.Target.Dependency = .product(name: "DequeModule", package: "swift-collections") |
| 20 | + |
| 21 | +var targets: [PackageDescription.Target] = [ |
| 22 | + .target(name: "NIOCore", |
| 23 | + dependencies: ["NIOConcurrencyHelpers", "CNIOLinux", "CNIOWindows", swiftCollections]), |
| 24 | + .target(name: "_NIODataStructures"), |
| 25 | + .target(name: "NIOEmbedded", |
| 26 | + dependencies: ["NIOCore", |
| 27 | + "NIOConcurrencyHelpers", |
| 28 | + "_NIODataStructures", |
| 29 | + swiftAtomics]), |
| 30 | + .target(name: "NIOPosix", |
| 31 | + dependencies: ["CNIOLinux", |
| 32 | + "CNIODarwin", |
| 33 | + "CNIOWindows", |
| 34 | + "NIOConcurrencyHelpers", |
| 35 | + "NIOCore", |
| 36 | + "_NIODataStructures", |
| 37 | + swiftAtomics]), |
| 38 | + .target(name: "NIO", |
| 39 | + dependencies: ["NIOCore", |
| 40 | + "NIOEmbedded", |
| 41 | + "NIOPosix"]), |
| 42 | + .target(name: "_NIOConcurrency", |
| 43 | + dependencies: ["NIO", "NIOCore"]), |
| 44 | + .target(name: "_NIOBeta", |
| 45 | + dependencies: ["NIOCore"]), |
| 46 | + .target(name: "NIOFoundationCompat", dependencies: ["NIO", "NIOCore"]), |
| 47 | + .target(name: "CNIOAtomics", dependencies: []), |
| 48 | + .target(name: "CNIOSHA1", dependencies: []), |
| 49 | + .target(name: "CNIOLinux", dependencies: []), |
| 50 | + .target(name: "CNIODarwin", dependencies: [], cSettings: [.define("__APPLE_USE_RFC_3542")]), |
| 51 | + .target(name: "CNIOWindows", dependencies: []), |
| 52 | + .target(name: "NIOConcurrencyHelpers", |
| 53 | + dependencies: ["CNIOAtomics"]), |
| 54 | + .target(name: "NIOHTTP1", |
| 55 | + dependencies: ["NIO", "NIOCore", "NIOConcurrencyHelpers", "CNIOHTTPParser"]), |
| 56 | + .executableTarget(name: "NIOEchoServer", |
| 57 | + dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], |
| 58 | + exclude: ["README.md"]), |
| 59 | + .executableTarget(name: "NIOEchoClient", |
| 60 | + dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], |
| 61 | + exclude: ["README.md"]), |
| 62 | + .executableTarget(name: "NIOHTTP1Server", |
| 63 | + dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOConcurrencyHelpers"], |
| 64 | + exclude: ["README.md"]), |
| 65 | + .executableTarget(name: "NIOHTTP1Client", |
| 66 | + dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOConcurrencyHelpers"], |
| 67 | + exclude: ["README.md"]), |
| 68 | + .target(name: "CNIOHTTPParser"), |
| 69 | + .target(name: "NIOTLS", dependencies: ["NIO", "NIOCore"]), |
| 70 | + .executableTarget(name: "NIOChatServer", |
| 71 | + dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], |
| 72 | + exclude: ["README.md"]), |
| 73 | + .executableTarget(name: "NIOChatClient", |
| 74 | + dependencies: ["NIOPosix", "NIOCore", "NIOConcurrencyHelpers"], |
| 75 | + exclude: ["README.md"]), |
| 76 | + .target(name: "NIOWebSocket", |
| 77 | + dependencies: ["NIO", "NIOCore", "NIOHTTP1", "CNIOSHA1"]), |
| 78 | + .executableTarget(name: "NIOWebSocketServer", |
| 79 | + dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOWebSocket"], |
| 80 | + exclude: ["README.md"]), |
| 81 | + .executableTarget(name: "NIOWebSocketClient", |
| 82 | + dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1", "NIOWebSocket"], |
| 83 | + exclude: ["README.md"]), |
| 84 | + .executableTarget(name: "NIOPerformanceTester", |
| 85 | + dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", "NIOFoundationCompat", "NIOWebSocket"]), |
| 86 | + .executableTarget(name: "NIOMulticastChat", |
| 87 | + dependencies: ["NIOPosix", "NIOCore"]), |
| 88 | + .executableTarget(name: "NIOUDPEchoServer", |
| 89 | + dependencies: ["NIOPosix", "NIOCore"], |
| 90 | + exclude: ["README.md"]), |
| 91 | + .executableTarget(name: "NIOUDPEchoClient", |
| 92 | + dependencies: ["NIOPosix", "NIOCore"], |
| 93 | + exclude: ["README.md"]), |
| 94 | + .target(name: "NIOTestUtils", |
| 95 | + dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", swiftAtomics]), |
| 96 | + .executableTarget(name: "NIOCrashTester", |
| 97 | + dependencies: ["NIOPosix", "NIOCore", "NIOEmbedded", "NIOHTTP1", "NIOWebSocket", "NIOFoundationCompat"]), |
| 98 | + .executableTarget(name: "NIOAsyncAwaitDemo", |
| 99 | + dependencies: ["NIOPosix", "NIOCore", "NIOHTTP1"]), |
| 100 | + .testTarget(name: "NIOCoreTests", |
| 101 | + dependencies: ["NIOCore", "NIOEmbedded", "NIOFoundationCompat"]), |
| 102 | + .testTarget(name: "NIOBetaTests", |
| 103 | + dependencies: ["_NIOBeta"]), |
| 104 | + .testTarget(name: "NIOEmbeddedTests", |
| 105 | + dependencies: ["NIOConcurrencyHelpers", "NIOCore", "NIOEmbedded"]), |
| 106 | + .testTarget(name: "NIOPosixTests", |
| 107 | + dependencies: ["NIOPosix", "NIOCore", "NIOFoundationCompat", "NIOTestUtils", "NIOConcurrencyHelpers", "NIOEmbedded"]), |
| 108 | + .testTarget(name: "NIOConcurrencyHelpersTests", |
| 109 | + dependencies: ["NIOConcurrencyHelpers", "NIOCore"]), |
| 110 | + .testTarget(name: "NIODataStructuresTests", |
| 111 | + dependencies: ["_NIODataStructures"]), |
| 112 | + .testTarget(name: "NIOHTTP1Tests", |
| 113 | + dependencies: ["NIOCore", "NIOEmbedded", "NIOPosix", "NIOHTTP1", "NIOFoundationCompat", "NIOTestUtils"]), |
| 114 | + .testTarget(name: "NIOTLSTests", |
| 115 | + dependencies: ["NIOCore", "NIOEmbedded", "NIOTLS", "NIOFoundationCompat"]), |
| 116 | + .testTarget(name: "NIOWebSocketTests", |
| 117 | + dependencies: ["NIOCore", "NIOEmbedded", "NIOWebSocket"]), |
| 118 | + .testTarget(name: "NIOTestUtilsTests", |
| 119 | + dependencies: ["NIOTestUtils", "NIOCore", "NIOEmbedded", "NIOPosix"]), |
| 120 | + .testTarget(name: "NIOFoundationCompatTests", |
| 121 | + dependencies: ["NIOCore", "NIOFoundationCompat"]), |
| 122 | + .testTarget(name: "NIOTests", |
| 123 | + dependencies: ["NIO"]), |
| 124 | +] |
| 125 | + |
| 126 | +let package = Package( |
| 127 | + name: "swift-nio", |
| 128 | + products: [ |
| 129 | + .library(name: "NIOCore", targets: ["NIOCore"]), |
| 130 | + .library(name: "NIO", targets: ["NIO"]), |
| 131 | + .library(name: "NIOEmbedded", targets: ["NIOEmbedded"]), |
| 132 | + .library(name: "NIOPosix", targets: ["NIOPosix"]), |
| 133 | + .library(name: "_NIOConcurrency", targets: ["_NIOConcurrency"]), |
| 134 | + .library(name: "_NIOBeta", targets: ["_NIOBeta"]), |
| 135 | + .library(name: "NIOTLS", targets: ["NIOTLS"]), |
| 136 | + .library(name: "NIOHTTP1", targets: ["NIOHTTP1"]), |
| 137 | + .library(name: "NIOConcurrencyHelpers", targets: ["NIOConcurrencyHelpers"]), |
| 138 | + .library(name: "NIOFoundationCompat", targets: ["NIOFoundationCompat"]), |
| 139 | + .library(name: "NIOWebSocket", targets: ["NIOWebSocket"]), |
| 140 | + .library(name: "NIOTestUtils", targets: ["NIOTestUtils"]), |
| 141 | + ], |
| 142 | + dependencies: [ |
| 143 | + .package(url: "https://github.com/apple/swift-atomics.git", from: "1.0.2"), |
| 144 | + .package(url: "https://github.com/apple/swift-collections.git", from: "1.0.2"), |
| 145 | + ], |
| 146 | + targets: targets |
| 147 | +) |
0 commit comments