-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Package.swift
164 lines (161 loc) · 7.84 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let swiftSettings: [SwiftSetting] = [.enableExperimentalFeature("StrictConcurrency=complete")]
let package = Package(
name: "hummingbird",
platforms: [.macOS(.v14), .iOS(.v17), .tvOS(.v17)],
products: [
.library(name: "Hummingbird", targets: ["Hummingbird"]),
.library(name: "HummingbirdCore", targets: ["HummingbirdCore"]),
.library(name: "HummingbirdHTTP2", targets: ["HummingbirdHTTP2"]),
.library(name: "HummingbirdTLS", targets: ["HummingbirdTLS"]),
.library(name: "HummingbirdRouter", targets: ["HummingbirdRouter"]),
.library(name: "HummingbirdTesting", targets: ["HummingbirdTesting"]),
.executable(name: "PerformanceTest", targets: ["PerformanceTest"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.2"),
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.0"),
.package(url: "https://github.com/apple/swift-http-types.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-metrics.git", from: "2.5.0"),
.package(url: "https://github.com/apple/swift-distributed-tracing.git", from: "1.0.1"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.63.0"),
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.20.0"),
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.28.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.14.0"),
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.20.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.0.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.19.0"),
],
targets: [
.target(
name: "Hummingbird",
dependencies: [
.byName(name: "HummingbirdCore"),
.product(name: "ServiceLifecycle", package: "swift-service-lifecycle"),
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
.product(name: "Atomics", package: "swift-atomics"),
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "Logging", package: "swift-log"),
.product(name: "Metrics", package: "swift-metrics"),
.product(name: "Tracing", package: "swift-distributed-tracing"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
],
swiftSettings: swiftSettings
),
.target(
name: "HummingbirdCore",
dependencies: [
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
.product(name: "Collections", package: "swift-collections"),
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
.product(name: "NIOHTTPTypes", package: "swift-nio-extras"),
.product(name: "NIOHTTPTypesHTTP1", package: "swift-nio-extras"),
.product(name: "NIOExtras", package: "swift-nio-extras"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOTransportServices", package: "swift-nio-transport-services"),
.product(name: "ServiceLifecycle", package: "swift-service-lifecycle"),
],
swiftSettings: swiftSettings
),
.target(
name: "HummingbirdRouter",
dependencies: [
.byName(name: "Hummingbird"),
.product(name: "Logging", package: "swift-log"),
],
swiftSettings: swiftSettings
),
.target(
name: "HummingbirdTesting",
dependencies: [
.byName(name: "Hummingbird"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOHTTPTypes", package: "swift-nio-extras"),
.product(name: "NIOHTTPTypesHTTP1", package: "swift-nio-extras"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOSSL", package: "swift-nio-ssl"),
],
swiftSettings: swiftSettings
),
.target(
name: "HummingbirdHTTP2",
dependencies: [
.byName(name: "HummingbirdCore"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOHTTP2", package: "swift-nio-http2"),
.product(name: "NIOHTTPTypes", package: "swift-nio-extras"),
.product(name: "NIOHTTPTypesHTTP1", package: "swift-nio-extras"),
.product(name: "NIOHTTPTypesHTTP2", package: "swift-nio-extras"),
.product(name: "NIOSSL", package: "swift-nio-ssl"),
]
),
.target(
name: "HummingbirdTLS",
dependencies: [
.byName(name: "HummingbirdCore"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOSSL", package: "swift-nio-ssl"),
],
swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]
),
.executableTarget(
name: "PerformanceTest",
dependencies: [
.byName(name: "Hummingbird"),
.product(name: "NIOPosix", package: "swift-nio"),
],
swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]
),
// test targets
.testTarget(
name: "HummingbirdTests",
dependencies: [
.byName(name: "Hummingbird"),
.byName(name: "HummingbirdTLS"),
.byName(name: "HummingbirdHTTP2"),
.byName(name: "HummingbirdTesting"),
.byName(name: "HummingbirdRouter"),
]
),
.testTarget(
name: "HummingbirdRouterTests",
dependencies: [
.byName(name: "HummingbirdRouter"),
.byName(name: "HummingbirdTesting"),
]
),
.testTarget(
name: "HummingbirdCoreTests",
dependencies: [
.byName(name: "HummingbirdCore"),
.byName(name: "HummingbirdTLS"),
.byName(name: "HummingbirdTesting"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
],
resources: [.process("Certificates")]
),
.testTarget(
name: "HummingbirdHTTP2Tests",
dependencies: [
.byName(name: "HummingbirdCore"),
.byName(name: "HummingbirdHTTP2"),
.byName(name: "HummingbirdTesting"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
]
),
],
swiftLanguageVersions: [.v5, .version("6")]
)