-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPackage.swift
154 lines (150 loc) · 3.39 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
// 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/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"
),
.testTarget(
name: "TemplateTests",
dependencies: [
.template,
]
),
.target(
name: "TidalAPI",
dependencies: [
.AnyCodable,
.auth,
.common,
]
),
.target(
name: "Common",
dependencies: [
.Logging,
.AnyCodable,
]
),
.testTarget(
name: "CommonTests",
dependencies: [
.common,
]
),
.target(
name: "EventProducer",
dependencies: [
.common,
.GRDB,
.SWXMLHash,
.auth,
]
),
.testTarget(
name: "EventProducerTests",
dependencies: [
.eventProducer,
.auth,
.common,
]
),
.target(
name: "Auth",
dependencies: [
.common,
.KeychainAccess,
.Logging,
]
),
.testTarget(
name: "AuthTests",
dependencies: [
.auth,
]
),
.target(
name: "Player",
dependencies: [
.common,
.Kronos,
.auth,
.eventProducer,
.GRDB,
],
resources: [
.process("README.md"),
]
),
.testTarget(
name: "PlayerTests",
dependencies: [
.player,
.auth,
.GRDB,
],
resources: [
.process("Resources"),
]
),
]
)
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")
}