Skip to content

Commit 6b3a0a5

Browse files
committed
feat(swift): add public SwiftPM package entry
1 parent da263ab commit 6b3a0a5

4 files changed

Lines changed: 46 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ DerivedData/
1919
*.xcframework.zip
2020
Info.plist
2121
Sources
22+
!cktap-swift/Sources/
23+
!cktap-swift/Sources/**
2224
lib*.a
2325

2426
# Python ck-tap emulator

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+
// Update tag and checksum when publishing a new Swift binary release.
7+
let tag = "v0.1.0"
8+
let checksum = "0000000000000000000000000000000000000000000000000000000000000000"
9+
let url = "https://github.com/notmandatory/rust-cktap/releases/download/\(tag)/cktapFFI.xcframework.zip"
10+
11+
let package = Package(
12+
name: "rust-cktap",
13+
platforms: [
14+
.macOS(.v12),
15+
.iOS(.v18),
16+
],
17+
products: [
18+
.library(
19+
name: "CKTap",
20+
targets: ["cktapFFI", "CKTap"]
21+
),
22+
],
23+
targets: [
24+
.target(
25+
name: "CKTap",
26+
dependencies: ["cktapFFI"],
27+
path: "./cktap-swift/Sources"
28+
),
29+
.binaryTarget(
30+
name: "cktapFFI",
31+
url: url,
32+
checksum: checksum
33+
),
34+
]
35+
)

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ just run certs
8484
just run read
8585
```
8686

87+
## Swift Package
88+
89+
Swift bindings are distributed from this repo as a Swift Package. Once a
90+
release includes `cktapFFI.xcframework.zip`, add the repository URL in Xcode
91+
and use the `CKTap` product.
92+
93+
See `cktap-swift/README.md` for local development and release steps.
94+
8795
## Minimum Supported Rust Version (MSRV)
8896

8997
This library should always compile with any valid combination of features on Rust **1.85.0**.

cktap-swift/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let package = Package(
77
name: "cktap-swift",
88
platforms: [
99
.macOS(.v12),
10-
.iOS(.v15)
10+
.iOS(.v18)
1111
],
1212
products: [
1313
.library(

0 commit comments

Comments
 (0)