-
Notifications
You must be signed in to change notification settings - Fork 1
/
Package.swift
50 lines (43 loc) · 1.69 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
// swift-tools-version:5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
var pDependencies = [PackageDescription.Package.Dependency]()
var wDependencies = [PackageDescription.Target.Dependency]()
#if os(macOS) || os(iOS)
// ios 和 macos不需要这个,系统自带了
#else
let latestVersion: Range<Version> = "0.0.1"..<"99.99.99"
pDependencies += [
.package(url: "https://github.com/zhtut/CombineX.git", latestVersion),
.package(url: "https://github.com/vapor/websocket-kit.git", from: "2.3.1"),
]
wDependencies += [
"CombineX",
.product(name: "WebSocketKit", package: "websocket-kit"),
]
#endif
var targets = [Target]()
targets.append(.target(name: "Networking"))
targets.append(.target(name: "WebSocket", dependencies: wDependencies))
#if os(macOS) || os(iOS)
// linux等不支持Challenge
targets.append(.target(name: "Challenge"))
#endif
var testTargetDependencies = [PackageDescription.Target.Dependency]()
testTargetDependencies.append("Networking")
testTargetDependencies.append("WebSocket")
#if os(macOS) || os(iOS)
// linux等不支持Challenge
testTargetDependencies.append("Challenge")
#endif
targets.append(.testTarget(name: "NetworkingTests", dependencies: testTargetDependencies))
let package = Package(name: "Networking",
platforms: [
.macOS(.v10_15),
.iOS(.v13)
],
products: [
.library(name: "Networking", targets: targets.dropLast().map({ $0.name })),
],
dependencies: pDependencies,
targets: targets)