-
Notifications
You must be signed in to change notification settings - Fork 1
/
Package.swift
87 lines (79 loc) · 2.59 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
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
var swiftSettings: [SwiftSetting] = [
.enableExperimentalFeature("StrictConcurrency")
]
let sargonBinaryTargetName = "SargonCoreRS"
let binaryTarget: Target
let useLocalFramework = true
if useLocalFramework {
binaryTarget = .binaryTarget(
name: sargonBinaryTargetName,
// IMPORTANT: Swift packages importing this locally will not be able to
// import SargonCore unless you specify this as a relative path!
path: "./target/swift/libsargon-rs.xcframework"
)
} else {
let releaseTag = "0.1.0"
let releaseChecksum = "befef7d56108305ff6ff69d67483471395c3e603e299b3b15f5a826328de272b"
binaryTarget = .binaryTarget(
name: sargonBinaryTargetName,
url:
"https://github.com/radixdlt/sargon/releases/download/\(releaseTag)/libsargon-rs.xcframework.zip",
checksum: releaseChecksum
)
}
let package = Package(
name: "Sargon",
platforms: [
.iOS(.v16), .macOS(.v13),
],
products: [
.library(
name: "Sargon",
targets: ["Sargon"]
)
],
dependencies: [
// We use XCTestDynamicOverlay to have different `description` of e.g. Decimal192
// for tests vs not tests (we use a .test `Locale`)
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.1.2"),
// `XCTAssertNoDifference` used in test
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.0"),
// Hopefully only temporary! We use `SwiftJSON` to be able to mark some Sargon models
// as `Swift.Codable`. See the SargonObjectCodable protocol for details.
// In the future hopefully no JSON coding happens in wallets,
// i.e. Sargon does ALL JSON coding, then we can remove this.
.package(url: "https://github.com/SwiftyJSON/SwiftyJSON", from: "5.0.2"),
// Multicast / Share of notifications in EventBus
.package(url: "https://github.com/sideeffect-io/AsyncExtensions", exact: "0.5.3"),
],
targets: [
binaryTarget,
.target(
name: "SargonUniFFI",
dependencies: [.target(name: sargonBinaryTargetName)],
path: "apple/Sources/UniFFI"
),
.target(
name: "Sargon",
dependencies: [
.target(name: "SargonUniFFI"),
"SwiftyJSON",
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"),
"AsyncExtensions"
],
path: "apple/Sources/Sargon",
swiftSettings: swiftSettings
),
.testTarget(
name: "SargonTests",
dependencies: [
.target(name: "Sargon"),
.product(name: "CustomDump", package: "swift-custom-dump"),
],
path: "apple/Tests"
),
]
)