-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackage.swift
More file actions
63 lines (59 loc) · 1.93 KB
/
Package.swift
File metadata and controls
63 lines (59 loc) · 1.93 KB
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
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
// Release configuration - updated automatically by CI on release
let releaseTag = "0.0.16"
let releaseChecksum = "bc5eb0c2fd4fbd8c712b14bf7f4374ba51e72a301de73c8ca4928e89bc522435"
// Use remote binary for releases, local path for development
let binaryTarget: Target
if !releaseTag.isEmpty {
binaryTarget = .binaryTarget(
name: "AutonomiCoreRS",
url: "https://github.com/maidsafe/ant-ffi/releases/download/\(releaseTag)/libant_ffi-rs.xcframework.zip",
checksum: releaseChecksum
)
} else {
// Local development: run `cd rust && ./build-ios.sh` first
binaryTarget = .binaryTarget(
name: "AutonomiCoreRS",
path: "./rust/target/ios/libant_ffi-rs.xcframework"
)
}
let package = Package(
name: "Autonomi",
platforms: [
.iOS(.v16),
.macOS(.v10_15),
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "Autonomi",
targets: ["Autonomi"]
),
],
targets: [
binaryTarget,
.target(
name: "Autonomi",
dependencies: [.target(name: "UniFFI")],
path: "apple/Sources/Autonomi"
),
.target(
name: "UniFFI",
dependencies: [.target(name: "AutonomiCoreRS")],
path: "apple/Sources/UniFFI",
linkerSettings: [
.linkedFramework("SystemConfiguration"),
.linkedFramework("Security"),
.linkedFramework("CoreFoundation"),
.linkedLibrary("resolv")
]
),
.testTarget(
name: "AutonomiTests",
dependencies: ["Autonomi"],
path: "apple/Tests/AutonomiTests"
),
]
)