-
Notifications
You must be signed in to change notification settings - Fork 27
/
Package.swift
137 lines (130 loc) · 4.42 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
// 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.26.0"
let releaseChecksum = "adb81b5b98cd79c4f6597ac873a86f772c714662421cff67efedad42bb7e20cb"
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.4.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.15.0"
),
],
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"),
.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: "FerrostarCoreTests",
dependencies: [
"FerrostarCore",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
path: "apple/Tests/FerrostarCoreTests"
),
.testTarget(
name: "FerrostarSwiftUITests",
dependencies: [
"FerrostarCore",
"FerrostarSwiftUI",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
path: "apple/Tests/FerrostarSwiftUITests"
),
]
)