-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackage.swift
More file actions
162 lines (153 loc) · 4.21 KB
/
Package.swift
File metadata and controls
162 lines (153 loc) · 4.21 KB
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
// swift-tools-version:5.4
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
var dependencies: [Package.Dependency] = []
var products: [Product] = []
var targetDependencies: [Target.Dependency] = []
var targets: [Target] = []
dependencies.append(.package(name: "AEXML", url: "https://github.com/tadija/AEXML.git", from: "4.5.0"))
dependencies.append(.package(name: "CryptoSwift", url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.9.0")) // 1.3.0
dependencies.append(.package(name: "Queuer", url: "https://github.com/FabrizioBrancati/Queuer.git", from: "2.0.0"))
#if !os(Linux)
dependencies.append(.package(name: "DataCompression", url: "https://github.com/mw99/DataCompression.git", from: "3.9.0"))
#endif
dependencies.append(.package(url: "https://github.com/apple/swift-argument-parser", from: "0.4.0"))
dependencies.append(.package(url: "https://github.com/groue/GRDB.swift.git", from: "6.0.0"))
dependencies.append(.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"))
dependencies.append(.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"))
targetDependencies.append(.byName(name: "AEXML"))
targetDependencies.append(.byName(name: "CryptoSwift"))
targetDependencies.append(.byName(name: "SocketSwift"))
targetDependencies.append(.byName(name: "Queuer"))
#if !os(Linux)
targetDependencies.append(.byName(name: "DataCompression"))
#else
targetDependencies.append(.byName(name: "CZlib"))
targetDependencies.append(.byName(name: "CLZ4"))
#endif
targetDependencies.append(.product(name: "Crypto", package: "swift-crypto"))
// Note: GRDB is added directly to the wired3 target below, not to WiredSwift lib
targets.append(
.target(
name: "SocketSwift",
path: "Vendor/SocketSwift/Sources"
)
)
targets.append(
.target(
name: "WiredSwift",
dependencies: targetDependencies,
resources: [.copy("Resources/wired.xml")]
)
)
targets.append(
.testTarget(
name: "WiredSwiftTests",
dependencies: ["WiredSwift"]
)
)
targets.append(
.target(
name: "wired3Lib",
dependencies: [
.byName(name: "WiredSwift"),
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "GRDB", package: "GRDB.swift"),
],
path: "Sources/wired3",
exclude: ["main.swift"]
)
)
targets.append(
.executableTarget(
name: "wired3",
dependencies: ["wired3Lib"],
path: "Sources/wired3",
sources: ["main.swift"]
)
)
targets.append(
.testTarget(
name: "wired3Tests",
dependencies: [
"wired3Lib",
"WiredSwift",
.product(name: "GRDB", package: "GRDB.swift"),
]
)
)
targets.append(
.testTarget(
name: "wired3IntegrationTests",
dependencies: [
"wired3Lib",
"WiredSwift",
]
)
)
#if !os(Linux)
targets.append(
.executableTarget(
name: "WiredServerApp",
dependencies: [
.byName(name: "WiredSwift"),
.byName(name: "CryptoSwift")
],
resources: [
.process("Resources")
]
)
)
#endif
products.append(
.library(
name: "WiredSwift",
targets: ["WiredSwift"])
)
products.append(
.library(
name: "SocketSwift",
targets: ["SocketSwift"])
)
products.append(
.executable(
name: "wired3",
targets: ["wired3"])
)
#if !os(Linux)
products.append(
.executable(
name: "WiredServerApp",
targets: ["WiredServerApp"])
)
#endif
#if os(Linux)
targets.append(
.systemLibrary(
name: "CZlib",
pkgConfig: "zlib",
providers: [
.apt(["zlib1g-dev"]),
.brew(["zlib"])
]
)
)
targets.append(
.systemLibrary(
name: "CLZ4",
pkgConfig: "liblz4",
providers: [
.apt(["liblz4-dev"]),
.brew(["lz4"])
]
)
)
#endif
let package = Package(
name: "WiredSwift",
defaultLocalization: "en",
platforms: [.iOS(.v13), .macOS("13.0")],
products: products,
dependencies: dependencies,
targets: targets
)