forked from stadiamaps/ferrostar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
173 lines (164 loc) · 5.61 KB
/
Package.swift
File metadata and controls
173 lines (164 loc) · 5.61 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
163
164
165
166
167
168
169
170
171
172
173
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let binaryTarget: Target
let maplibreSwiftUIDSLPackage: Package.Dependency
let useLocalFramework = false
let useLocalMapLibreSwiftUIDSL = false
if useLocalFramework {
binaryTarget = .binaryTarget(
name: "FerrostarCoreRS",
// IMPORTANT: Swift packages importing this locally will not be able to
// import Ferrostar core unless you specify this as a relative path!
path: "./common/target/ios/libferrostar-rs.xcframework"
)
} else {
let releaseTag = "0.45.0"
let releaseChecksum = "72399f36e7f0b5b56017c5711f09a8cacc6b2f95cdb6bb5f74ae646821fabbdb"
binaryTarget = .binaryTarget(
name: "FerrostarCoreRS",
url:
"https://github.com/stadiamaps/ferrostar/releases/download/\(releaseTag)/libferrostar-rs.xcframework.zip",
checksum: releaseChecksum
)
}
if useLocalMapLibreSwiftUIDSL {
maplibreSwiftUIDSLPackage = .package(path: "../swiftui-dsl")
} else {
maplibreSwiftUIDSLPackage = .package(
url: "https://github.com/maplibre/swiftui-dsl",
from: "0.17.0"
)
}
let package = Package(
name: "FerrostarCore",
defaultLocalization: "en",
platforms: [
.iOS(.v16),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "FerrostarCore",
targets: ["FerrostarCore", "FerrostarCoreFFI"]
),
.library(
name: "FerrostarMapLibreUI",
targets: [
"FerrostarMapLibreUI",
"FerrostarSwiftUI",
"FerrostarCarPlayUI",
] // TODO: Remove FerrostarSwiftUI from FerrostarMapLibreUI once we can fix the demo app swift package config (broken in Xcode 15.3)
),
.library(
name: "FerrostarSwiftUI",
targets: ["FerrostarSwiftUI"]
),
.library(
name: "FerrostarCarPlayUI",
targets: ["FerrostarCarPlayUI"]
),
],
dependencies: [
maplibreSwiftUIDSLPackage,
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing",
from: "1.18.3"
),
],
targets: [
binaryTarget,
.target(
name: "FerrostarCarPlayUI",
dependencies: [
.target(name: "FerrostarCore"),
.target(name: "FerrostarSwiftUI"),
.target(name: "FerrostarMapLibreUI"),
.product(name: "MapLibreSwiftDSL", package: "swiftui-dsl"),
.product(name: "MapLibreSwiftUI", package: "swiftui-dsl"),
],
path: "apple/Sources/FerrostarCarPlayUI"
),
.target(
name: "FerrostarCore",
dependencies: [.target(name: "FerrostarCoreFFI")],
path: "apple/Sources/FerrostarCore"
),
.target(
name: "FerrostarMapLibreUI",
dependencies: [
.target(name: "FerrostarCore"),
.target(name: "FerrostarSwiftUI"),
.product(name: "MapLibreSwiftDSL", package: "swiftui-dsl"),
.product(name: "MapLibreSwiftUI", package: "swiftui-dsl"),
],
path: "apple/Sources/FerrostarMapLibreUI"
),
.target(
name: "FerrostarSwiftUI",
dependencies: [
.target(name: "FerrostarCore"),
],
path: "apple/Sources/FerrostarSwiftUI",
resources: [
.process("Resources"),
]
),
.target(
name: "FerrostarCoreFFI",
dependencies: [.target(name: "FerrostarCoreRS")],
path: "apple/Sources/UniFFI"
),
// MARK: Testing
.testTarget(
name: "FerrostarCarPlayUITests",
dependencies: [
"FerrostarCore",
"FerrostarSwiftUI",
"FerrostarCarPlayUI",
"TestSupport",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
path: "apple/Tests/FerrostarCarPlayUITests"
),
.testTarget(
name: "FerrostarCoreTests",
dependencies: [
"FerrostarCore",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
path: "apple/Tests/FerrostarCoreTests"
),
.testTarget(
name: "FerrostarMapLibreUITests",
dependencies: [
"FerrostarCore",
"FerrostarSwiftUI",
"FerrostarMapLibreUI",
"TestSupport",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
path: "apple/Tests/FerrostarMapLibreUITests"
),
.testTarget(
name: "FerrostarSwiftUITests",
dependencies: [
"FerrostarCore",
"FerrostarSwiftUI",
"TestSupport",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
path: "apple/Tests/FerrostarSwiftUITests"
),
// MARK: Test Support
.target(
name: "TestSupport",
dependencies: [
"FerrostarCore",
"FerrostarSwiftUI",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
path: "apple/Tests/TestSupport"
),
]
)