-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Package.swift
140 lines (126 loc) · 3.87 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
// swift-tools-version:5.6
import PackageDescription
let package = Package(
name: "SpotifyAPI",
platforms: [
.iOS(.v13),
.macOS(.v10_15),
.tvOS(.v13),
.watchOS(.v6)
],
products: [
.library(
name: "SpotifyAPI",
targets: ["SpotifyWebAPI"]
),
.library(
name: "SpotifyExampleContent",
targets: ["SpotifyExampleContent"]
),
.library(
name: "_SpotifyAPITestUtilities",
targets: ["SpotifyAPITestUtilities"]
)
],
dependencies: packageDependencies,
targets: [
.target(
name: "SpotifyWebAPI",
dependencies: [
.product(name: "RegularExpressions", package: "RegularExpressions"),
.product(name: "Logging", package: "swift-log"),
.product(name: "Crypto", package: "swift-crypto"),
.product(name: "OpenCombine", package: "OpenCombine"),
.product(name: "OpenCombineDispatch", package: "OpenCombine"),
.product(name: "OpenCombineFoundation", package: "OpenCombine")
],
exclude: ["README.md"]
),
.target(
name: "SpotifyExampleContent",
dependencies: ["SpotifyWebAPI"],
exclude: ["README.md"],
resources: [
.process("Resources")
]
),
.target(
name: "SpotifyAPITestUtilities",
dependencies: spotifyAPITestUtilitiesDependencies,
exclude: ["README.md"],
resources: [
.process("Resources")
]
),
// MARK: Test Targets
.testTarget(
name: "SpotifyAPIMainTests",
dependencies: [
"SpotifyWebAPI",
"SpotifyExampleContent",
"RegularExpressions",
"SpotifyAPITestUtilities"
]
)
]
)
var packageDependencies: [Package.Dependency] {
var dependencies: [Package.Dependency] = [
.package(
url: "https://github.com/Peter-Schorn/RegularExpressions.git",
from: "2.2.0"
),
.package(
url: "https://github.com/apple/swift-log.git",
from: "1.4.0"
),
.package(
url: "https://github.com/OpenCombine/OpenCombine.git",
from: "0.12.0"
),
.package(
url: "https://github.com/apple/swift-crypto.git",
from: "1.1.3"
),
.package(
url: "https://github.com/apple/swift-docc-plugin",
from: "1.2.0"
)
]
#if TEST
dependencies += [
.package(
url: "https://github.com/vapor/vapor.git",
from: "4.45.3"
),
.package(
url: "https://github.com/apple/swift-nio.git",
from: "2.27.0"
),
.package(
url: "https://github.com/swift-server/async-http-client.git",
from: "1.2.5"
)
]
#endif
return dependencies
}
var spotifyAPITestUtilitiesDependencies: [Target.Dependency] {
var dependencies: [Target.Dependency] = [
"SpotifyWebAPI",
"SpotifyExampleContent",
.product(name: "RegularExpressions", package: "RegularExpressions"),
.product(name: "OpenCombine", package: "OpenCombine"),
.product(name: "OpenCombineDispatch", package: "OpenCombine"),
.product(name: "OpenCombineFoundation", package: "OpenCombine")
]
#if TEST
dependencies += [
.product(name: "Vapor", package: "vapor"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIO", package: "swift-nio"),
.product(name: "AsyncHTTPClient", package: "async-http-client")
]
#endif
return dependencies
}