-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPackage.swift
77 lines (72 loc) · 2.37 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
// swift-tools-version:5.8
import PackageDescription
// Use the local binary if true
let useLocalBinary = Context.environment["VALHALLA_MOBILE_DEV"].flatMap(Bool.init) ?? false
// Use the local binary
var binaryTarget: Target = .binaryTarget(
name: "ValhallaWrapper",
path: "build/apple/valhalla-wrapper.xcframework"
)
// CI will replace the nils with the actual values when building a release
let version: String = "0.1.5"
let binaryURL: String =
"https://github.com/Rallista/valhalla-mobile/releases/download/\(version)/valhalla-wrapper.xcframework.zip"
let binaryChecksum: String = "976a523afca1117e962207db243d60430216c86d9a90b43ff33332dbd53006c9"
if !useLocalBinary {
binaryTarget = .binaryTarget(
name: "ValhallaWrapper",
url: binaryURL,
checksum: binaryChecksum
)
}
let package = Package(
name: "ValhallaMobile",
platforms: [
.iOS("16.4")
// .tvOS(.v13),
// .watchOS(.v6),
// .macOS(.v10_13)
],
products: [
.library(
name: "Valhalla",
targets: ["Valhalla"]
)
],
dependencies: [
.package(
url: "https://github.com/Rallista/valhalla-openapi-models-swift.git", exact: "0.0.4"),
.package(url: "https://github.com/UInt2048/Light-Swift-Untar.git", from: "1.0.4"),
],
targets: [
.target(
name: "Valhalla",
dependencies: [
"ValhallaObjc",
"ValhallaWrapper",
.product(name: "ValhallaConfigModels", package: "valhalla-openapi-models-swift"),
.product(name: "ValhallaModels", package: "valhalla-openapi-models-swift"),
.product(name: "Light-Swift-Untar", package: "Light-Swift-Untar"),
],
path: "apple/Sources/Valhalla",
resources: [
.process("SupportData")
]
),
.target(
name: "ValhallaObjc",
dependencies: ["ValhallaWrapper"],
path: "apple/Sources/ValhallaObjc",
linkerSettings: [.linkedLibrary("z")]
),
binaryTarget,
.testTarget(
name: "ValhallaTests",
dependencies: ["Valhalla"],
path: "apple/Tests/ValhallaTests",
resources: [.copy("TestData")]
),
],
cLanguageStandard: .gnu17,
cxxLanguageStandard: .cxx17
)