forked from Dekalabs/Cardano.swift
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Package.swift
77 lines (73 loc) · 2.36 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.4
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let useLocalBinary = false
var package = Package(
name: "Cardano",
platforms: [.iOS(.v13), .macOS(.v10_15)],
products: [
.library(
name: "Cardano",
targets: ["Cardano"]),
.library(
name: "CardanoCore",
targets: ["CardanoCore"])
],
dependencies: [
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.2.1"),
.package(name: "Bip39", url: "https://github.com/tesseract-one/Bip39.swift.git", from: "0.1.1"),
.package(url: "https://github.com/apple/swift-collections", from: "1.0.2")
],
targets: [
.target(
name: "Cardano",
dependencies: ["CardanoCore", "Bip39"]),
.target(
name: "CardanoCore",
dependencies: [
"CCardano",
"BigInt",
.product(name: "OrderedCollections", package: "swift-collections")
],
path: "Sources/Core",
swiftSettings: [.unsafeFlags(["-Onone"])]),
.testTarget(
name: "CoreTests",
dependencies: ["CardanoCore"]),
.testTarget(
name: "CardanoTests",
dependencies: ["Cardano"])
]
)
#if os(Linux)
package.targets.append(
.systemLibrary(name: "CCardano")
)
#else
let ccardano: Target = useLocalBinary ?
.binaryTarget(
name: "CCardano",
path: "rust/binaries/CCardano.xcframework") :
.binaryTarget(
name: "CCardano",
url: "https://github.com/tesseract-one/Cardano.swift/releases/download/0.1.4/CCardano.binaries.zip",
checksum: "50fa4995483338bab59ae6abf6bbfe50f6e05507bbcf4128087b75d049b9590e")
package.targets.append(contentsOf: [
ccardano,
.target(
name: "CardanoBlockfrost",
dependencies: ["Cardano", "BlockfrostSwiftSDK"],
path: "Sources/Blockfrost"),
.testTarget(
name: "BlockfrostTests",
dependencies: ["CardanoBlockfrost"])
])
package.products.append(
.library(
name: "CardanoBlockfrost",
targets: ["CardanoBlockfrost"])
)
package.dependencies.append(
.package(name: "BlockfrostSwiftSDK", url: "https://github.com/blockfrost/blockfrost-swift.git", from: "1.0.1")
)
#endif