-
Notifications
You must be signed in to change notification settings - Fork 24
/
Package.swift
121 lines (114 loc) · 3.81 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
// 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.22.0"
let releaseChecksum = "00b7372e4c0a3f3c63845d411db0b9841dffc7ed201af8a5ca4b279ef3eab516"
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.1.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",
] // 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"]
),
],
dependencies: [
maplibreSwiftUIDSLPackage,
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing",
from: "1.15.0"
),
],
targets: [
binaryTarget,
.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"
),
]
)