Skip to content

Commit 8510c21

Browse files
committed
Update Package.swift and prepare desc for SwiftPM
1 parent 513e7b2 commit 8510c21

File tree

2 files changed

+43
-17
lines changed

2 files changed

+43
-17
lines changed

Package.swift

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// swift-tools-version:5.5
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let tag = "0.1-alpha.1"
7+
let checksum = "d91403566498f01cdaaafc07a9360ef661151e64075c6d83bbce4c9b5bfa7cee"
8+
let url = "https://github.com/lightningdevkit/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip"
9+
10+
let package = Package(
11+
name: "ldk-node",
12+
platforms: [
13+
.iOS(.v15)
14+
.macOS(.v12),
15+
],
16+
products: [
17+
// Products define the executables and libraries a package produces, and make them visible to other packages.
18+
.library(
19+
name: "LDKNode",
20+
targets: ["LDKNodeFFI", "LDKNode"]),
21+
],
22+
targets: [
23+
.target(
24+
name: "LDKNode",
25+
dependencies: ["LDKNodeFFI"],
26+
path: "./bindings/swift/Sources",
27+
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
28+
)
29+
.binaryTarget(
30+
name: "LDKNodeFFI",
31+
url: url,
32+
checksum: checksum,
33+
),
34+
]
35+
)

bindings/swift/Package.swift

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,28 @@
11
// swift-tools-version:5.5
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
3-
43
import PackageDescription
54

65
let package = Package(
76
name: "ldk-node",
87
platforms: [
9-
.macOS(.v12),
108
.iOS(.v15)
9+
.macOS(.v12),
1110
],
1211
products: [
1312
// Products define the executables and libraries a package produces, and make them visible to other packages.
1413
.library(
1514
name: "LDKNode",
1615
targets: ["LDKNodeFFI", "LDKNode"]),
1716
],
18-
dependencies: [
19-
// Dependencies declare other packages that this package depends on.
20-
// .package(url: /* package url */, from: "1.0.0"),
21-
],
2217
targets: [
23-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
25-
// .binaryTarget(
26-
// name: "LDKNodeFFI",
27-
// url: "https://github.com/lightningdevkit/ldk-node/releases/download/0.3.0/LDKNodeFFI.xcframework.zip",
28-
// checksum: "<TBD>"),
29-
.binaryTarget(name: "LDKNodeFFI", path: "./LDKNodeFFI.xcframework"),
3018
.target(
3119
name: "LDKNode",
32-
dependencies: ["LDKNodeFFI"]),
33-
// .testTarget(
34-
// name: "LightningDevKitNodeTests",
35-
// dependencies: ["LightningDevKitNode"]),
20+
dependencies: ["LDKNodeFFI"],
21+
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
22+
)
23+
.binaryTarget(
24+
name: "LDKNodeFFI",
25+
path: "./LDKNodeFFI.xcframework",
26+
),
3627
]
3728
)

0 commit comments

Comments
 (0)