-
Notifications
You must be signed in to change notification settings - Fork 1
/
Package.swift
176 lines (172 loc) · 4.01 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
165
166
167
168
169
170
171
172
173
174
175
176
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.
import class Foundation.ProcessInfo
import PackageDescription
/// Only add DocC Plugin when building docs, so that clients of this library won't
/// unnecessarily also get the DocC Plugin
let environmentVariables = ProcessInfo.processInfo.environment
let shouldIncludeDocCPlugin = environmentVariables["INCLUDE_DOCC_PLUGIN"] == "true"
let package = Package(
name: "tidal-sdk-ios",
platforms: [
.iOS(.v15),
.macOS(.v12),
.tvOS(.v15),
.watchOS(.v7),
],
products: [
.library(
name: "EventProducer",
targets: ["EventProducer"]
),
.library(
name: "Auth",
targets: ["Auth"]
),
.library(
name: "Player",
targets: ["Player"]
),
.library(
name: "Common",
targets: ["Common"]
),
.library(
name: "TidalAPI",
targets: ["TidalAPI"]
),
],
dependencies: [
.package(url: "https://github.com/groue/GRDB.swift.git", from: "6.27.0"),
.package(url: "https://github.com/drmohundro/SWXMLHash.git", from: "7.0.2"),
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", from: "4.2.2"),
.package(url: "https://github.com/MobileNativeFoundation/Kronos.git", exact: "4.2.2"),
.package(url: "https://github.com/lukepistrol/SwiftLintPlugin", from: "0.54.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.6.1"),
.package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.0"),
] + (shouldIncludeDocCPlugin ? [.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")] : []),
targets: [
.target(
name: "Template",
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin"),
]
),
.testTarget(
name: "TemplateTests",
dependencies: [
.template,
]
),
.target(
name: "TidalAPI",
dependencies: [
.AnyCodable,
.auth,
.common,
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin"),
]
),
.target(
name: "Common",
dependencies: [
.Logging,
.AnyCodable,
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin"),
]
),
.testTarget(
name: "CommonTests",
dependencies: [
.common,
]
),
.target(
name: "EventProducer",
dependencies: [
.common,
.GRDB,
.SWXMLHash,
.auth,
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin"),
]
),
.testTarget(
name: "EventProducerTests",
dependencies: [
.eventProducer,
.auth,
.common,
]
),
.target(
name: "Auth",
dependencies: [
.common,
.KeychainAccess,
.Logging,
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin"),
]
),
.testTarget(
name: "AuthTests",
dependencies: [
.auth,
]
),
.target(
name: "Player",
dependencies: [
.common,
.Kronos,
.auth,
.eventProducer,
.GRDB,
],
resources: [
.process("README.md"),
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin"),
]
),
.testTarget(
name: "PlayerTests",
dependencies: [
.player,
.auth,
.GRDB,
],
resources: [
.process("Resources"),
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin"),
]
),
]
)
extension Target.Dependency {
/// Local
static let template = byName(name: "Template")
static let eventProducer = byName(name: "EventProducer")
static let tidalAPI = byName(name: "TidalAPI")
static let common = byName(name: "Common")
static let auth = byName(name: "Auth")
static let player = byName(name: "Player")
/// External
static let GRDB = product(name: "GRDB", package: "GRDB.swift")
static let SWXMLHash = product(name: "SWXMLHash", package: "SWXMLHash")
static let KeychainAccess = product(name: "KeychainAccess", package: "KeychainAccess")
static let Kronos = product(name: "Kronos", package: "Kronos")
static let Logging = product(name: "Logging", package: "swift-log")
static let AnyCodable = product(name: "AnyCodable", package: "AnyCodable")
}