-
Notifications
You must be signed in to change notification settings - Fork 2
/
Package.swift
254 lines (231 loc) · 12.2 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
// swift-tools-version: 5.7
// © 2022 TomTom N.V. All rights reserved.
//
// This software is the proprietary copyright of TomTom N.V. and its subsidiaries and may be
// used for internal evaluation purposes or commercial use strictly subject to separate
// license agreement between you and TomTom N.V. If you are the licensee, you are only permitted
// to use this software in accordance with the terms of your license agreement. If you are
// not the licensee, you are not authorized to use this software in any manner and should
// immediately return or destroy it.
import PackageDescription
let sdkVersion = "0.67.0"
let package = Package(
name: "TomTomSDKCoreFrameworks",
defaultLocalization: "en",
platforms: [.iOS(.v14)],
products: [ /* products are set later */ ],
dependencies: [],
targets: [ /* targets are set later */ ],
swiftLanguageVersions: [.v5]
)
let modules: [Module] = [
Module("TomTomSDKCommon", sha: "a87a1a7225d077087a05fc7fd3a2ea8f937c039f911b17be324d29286acf8392", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKBindingFrameworkLoggingInternal"),
]),
Module("TomTomSDKRoute", sha: "dfc64345078d0c79299447936f71efee52afc1297acc25374d24defc6a5fe653", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKRoutingCommon"),
]),
Module("TomTomSDKFeatureToggle", sha: "cffd94709f77b1603e7da23639fdbfd9c1e7605788eabb238c9fb82c97992622", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKNetworking", sha: "4194086596f551d7de6719db2b847975059315b167fbb01fa271030d150b552b", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKBindingFrameworkHTTPInternal"),
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKLocationProvider", sha: "a8a029e1c8d0be2267fd302d8435a72f91d2f1a2cc06f6d52bab958a668531d7", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKBindingMapDisplayEngineInternal", sha: "760fecc50c6d2487ee10232a3b2e50522a10f236829411f5e6d55c998fc2e895", version: "0.67.0"),
Module("TomTomSDKMapDisplay", sha: "571ef6994e6162f7da4bfd23121ceb4b6750b8e10c9eea95e8f537bc4bda8738", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKBindingMapDisplayEngineInternal"),
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKFeatureToggle"),
.corePackageModule("TomTomSDKLocationProvider"),
]),
Module("TomTomSDKRoutePlanner", sha: "c5c04ff6166383ce3dd809e6a68f20e79cddc1adebb607c935369a643207660c", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKRoute"),
.corePackageModule("TomTomSDKRoutingCommon"),
.corePackageModule("TomTomSDKTelemetry"),
]),
Module("TomTomSDKRoutePlannerOnline", sha: "f909b903bfb05c7c8e1024c017efafa4f376cac5881156204ec7452e972058cf", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKRoutePlanner"),
.corePackageModule("TomTomSDKRoute"),
.corePackageModule("TomTomSDKLocationProvider"),
.corePackageModule("TomTomSDKFeatureToggle"),
.corePackageModule("TomTomSDKRoutingCommon"),
.corePackageModule("TomTomSDKRangeCalculator"),
.corePackageModule("TomTomSDKTelemetry"),
]),
Module("TomTomSDKPersonalData", sha: "56c160ed8a0f75f610785f12c5fc1fba12afdcb1e1c388621472cbf08b187c3b", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKPersonalDataDefault", sha: "34e12b8dfaf400deff49cf2fbfe9bcebec56ce04fba3790fb328440b5211c25a", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKPersonalData"),
.corePackageModule("TomTomSDKMQTT"),
]),
Module("TomTomSDKSearch", sha: "a70df1aa6589ab854d6a433182ac45381fb8b67aed27fd0df5505a67c9ef58b6", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKSearchCommon", sha: "0bb08fc7b9d1103e49c0efd73109cab6debc60f1d20181221983ca799ccf7e35", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKSearch"),
]),
Module("TomTomSDKSearchOnline", sha: "bfff3a748c5fc4948dea41a40b7ea6702a222572fff8ebadda3601e6e5990af6", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKSearch"),
.corePackageModule("TomTomSDKSearchCommon"),
.corePackageModule("TomTomSDKFeatureToggle"),
]),
Module("TomTomSDKSearchUI", sha: "9e5ae8804e21653470de6e23768d7194dc883edbfba080a36c30d5a39b125c0a", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKCommonUI"),
.corePackageModule("TomTomSDKReverseGeocoder"),
.corePackageModule("TomTomSDKSearch"),
]),
Module("TomTomSDKCommonUI", sha: "00a78b61eafb5080e010bd81497e8dc00c062c686fc407af26da773aaeb1e6e7", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKReverseGeocoder", sha: "835c06962efaad931157345d26cfc44c1d6b839f2ad59510904e3cff589c6e1d", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKReverseGeocoderOnline", sha: "cbacc37256dc5cc76bdf84b5c6071bbd55af43cf98c388de0ed56efd636ae814", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKReverseGeocoder"),
.corePackageModule("TomTomSDKFeatureToggle"),
]),
Module("TomTomSDKBindingFrameworkHTTPInternal", sha: "e92a968c0402c4888ddeed99b3216a0ccd4cd0a781b5b3bd3c7d386a5b4bebef", version: "0.67.0"),
Module("TomTomSDKBindingFrameworkLoggingInternal", sha: "a9ea3730e567a2d218e88b9b10ffd4aecb9da921f4666e3def81d02c1dc66ffa", version: "0.67.0"),
Module("TomTomSDKTraffic", sha: "cb37bd0afcd24effcf3357a704f19eb7f55648886233b83dd6767f3eaa725c09", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKLocationProvider"),
]),
Module("TomTomSDKDynamicData", sha: "1b4436b07021b04d93a0b04e53dc451fe0e2a296af61e57cfcb1c0315b989b5b", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKSearch"),
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKDynamicDataOnline", sha: "c5f113489154c9b2ef7de8f6ef1d79cb030980b695de654689ac117371b2c7cc", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKSearch"),
.corePackageModule("TomTomSDKDynamicData"),
.corePackageModule("TomTomSDKFeatureToggle"),
]),
Module("TomTomSDKVehicle", sha: "76d26f216892ab0b144c37b7424f77c73129f6c21d3746d311ba72cf3f9d92b7", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKTrafficDataProvider", sha: "9ee34e42be6aa62260c1a2cebad704200ada8cf35a0cb3190550b37d10317909", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKTraffic"),
.corePackageModule("TomTomSDKMapDisplay"),
.corePackageModule("TomTomSDKBindingTrafficTileGeneratorInternal"),
]),
Module("TomTomSDKBindingTrafficTileGeneratorInternal", sha: "20564aef3f5553867b39ca79ab1a9a55e3e21e3c7769a44d2a1f0b2cbb3ca59d", version: "0.67.0"),
Module("TomTomSDKRoutingVisualization", sha: "e993beab3362fc45176f02758cdf3ac011b27f8e6a6570345a540c81ec4828e4", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKMapDisplay"),
.corePackageModule("TomTomSDKRoute"),
]),
Module("TomTomSDKSearchVisualization", sha: "d7c6f35355d7bba40358a7f81575feb4614a8b97b37fe7ddbf36023adc24260b", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKSearch"),
.corePackageModule("TomTomSDKPOIVisualization"),
]),
Module("TomTomSDKMQTT", sha: "506ca5412706b9010720567357f7208b09a4d3d6713104b124517d2cbaffbf72", version: "0.67.0", dependencies: [
// core package dependencies
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKPOIVisualization", sha: "5cf9fdfb1003865c34936ff47b45d1e217689724adf896a4b739278cd227bfbb", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKMapDisplay"),
.corePackageModule("TomTomSDKCommon"),
]),
Module("TomTomSDKRangeVisualization", sha: "6d169063eb3b8925666dba8e695c08d2fff720e10f5f70d5a3fb5b0b5d0734df", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKMapDisplay"),
]),
Module("TomTomSDKRoutingCommon", sha: "902e1559c8bde2b2bdeb13356f21e810b961d9ed1655086e664f47a7947475ea", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKFeatureToggle"),
]),
Module("TomTomSDKRangeCalculator", sha: "74cf1208130a0cb3aca6154bd3662dad4a98aadf2e947444f92418ad4284c4de", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKRoute"),
.corePackageModule("TomTomSDKRoutingCommon"),
]),
Module("TomTomSDKTelemetry", sha: "e5b392b66e21d9dbe90a892b4901202f4cd9f0cde1e770bc033d53b4a311cb92", version: "0.67.0", dependencies: [
.corePackageModule("TomTomSDKCommon"),
.corePackageModule("TomTomSDKLocationProvider"),
.corePackageModule("TomTomSDKRoute"),
]),
]
package.products = modules.products
package.targets = modules.targets
private extension String {
func artefactUrl(version: String) -> String {
"https://repositories.tomtom.com/artifactory/spm/TomTomSDK/Core/binaries/\(self)/\(version)/\(self).zip"
}
var wrapperName: String {
return self + "Wrapper"
}
}
struct Module {
let frameworkName: String
let sha: String
let dependencies: [ModuleDependency]
let version: String
let isProduct: Bool
init(_ frameworkName: String, sha: String, version: String, isProduct: Bool = true, dependencies: [ModuleDependency] = []) {
self.frameworkName = frameworkName
self.sha = sha
self.version = version
self.isProduct = isProduct
self.dependencies = dependencies
}
var product: Product? {
return isProduct ? .library(name: frameworkName, targets: [wrapperName]) : nil
}
var wrapperName: String {
frameworkName.wrapperName
}
var targets: [Target] {
let binaryTargetDependency: Target.Dependency = .target(name: frameworkName)
let dependenciesTargets: [Target.Dependency] = dependencies.map { $0.dependency }
let mainTargetDependencies = [binaryTargetDependency] + dependenciesTargets
let mainTarget: Target = .target(name: wrapperName, dependencies: mainTargetDependencies)
let binaryUrl = frameworkName.artefactUrl(version: version)
let binaryTarget: Target = .binaryTarget(name: frameworkName, url: binaryUrl, checksum: sha)
return [mainTarget, binaryTarget]
}
}
struct ModuleDependency {
let name: String
let package: String?
var dependency: Target.Dependency {
if let package = package {
return .product(name: name, package: package)
}
return .target(name: name.wrapperName)
}
static func thirdpartyPackageModule(_ name: String, package: String) -> ModuleDependency {
ModuleDependency(name: name, package: package)
}
static func corePackageModule(_ name: String) -> ModuleDependency {
ModuleDependency(name: name, package: nil)
}
}
extension ModuleDependency: ExpressibleByStringLiteral {
init(stringLiteral value: String) {
self.init(name: value, package: nil)
}
public typealias StringLiteralType = String
}
extension Array where Element == Module {
var products: [Product] {
compactMap { $0.product }
}
var targets: [Target] {
flatMap { $0.targets }
}
}