Skip to content

Commit 6c8304d

Browse files
committed
update swift
1 parent fc83271 commit 6c8304d

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ let package = Package(
3636
// .binaryTarget(name: "lniFFI", path: "bindings/swift/lniFFI.xcframework")
3737
.binaryTarget(
3838
name: "lniFFI",
39-
url: "https://github.com/lightning-node-interface/lni/releases/download/v0.1.1/lniFFI.xcframework.zip",
40-
checksum: "f02f262261524e0dac11bb0560be8526f482e27d7f4f87be532f4ba74aa38c2c"
39+
url: "https://github.com/lightning-node-interface/lni/releases/download/v0.1.3/lniFFI.xcframework.zip",
40+
checksum: "bd31af9c6e7744a87d8e5283d87be241acd6693dd72d5a2c47104503ccbaaa9e"
4141
)
4242
]
4343
)

bindings/swift/build.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ ls -la "$OUTPUT_DIR"
151151
# Create XCFramework if iOS builds were requested
152152
if [ "$BUILD_IOS" = true ]; then
153153
LIBS_DIR="$SCRIPT_DIR/libs"
154-
HEADERS_DIR="$SCRIPT_DIR/include"
154+
HEADERS_DIR="$SCRIPT_DIR/include/lniFFI"
155155

156-
# Copy headers for XCFramework
156+
# Copy headers for XCFramework (in subdirectory to avoid conflicts)
157157
mkdir -p "$HEADERS_DIR"
158158
cp "$OUTPUT_DIR/lniFFI.h" "$HEADERS_DIR/"
159159
cp "$OUTPUT_DIR/lniFFI.modulemap" "$HEADERS_DIR/module.modulemap"
@@ -172,9 +172,12 @@ if [ "$BUILD_IOS" = true ]; then
172172

173173
echo " Created $XCFRAMEWORK_DIR"
174174

175-
# Fix modulemap naming to avoid conflicts with other xcframeworks
176-
find "$XCFRAMEWORK_DIR" -name "module.modulemap" -exec sh -c 'mv "$1" "$(dirname "$1")/lniFFI.modulemap"' _ {} \;
177-
echo " Renamed module.modulemap to lniFFI.modulemap"
175+
# Update Info.plist to use lniFFI subdirectory for headers
176+
find "$XCFRAMEWORK_DIR" -name "Info.plist" -exec plutil -replace LibraryIdentifier -string "$(plutil -extract LibraryIdentifier raw {})" {} \; 2>/dev/null || true
177+
for plist in $(find "$XCFRAMEWORK_DIR" -path "*/*/Info.plist"); do
178+
plutil -replace HeadersPath -string "Headers/lniFFI" "$plist"
179+
done
180+
echo " Updated HeadersPath to Headers/lniFFI"
178181

179182
echo ""
180183
echo "XCFramework created successfully!"
@@ -215,7 +218,8 @@ if [ "$BUILD_IOS" = true ]; then
215218
echo " - Checksum: $CHECKSUM"
216219
echo ""
217220
echo "Next steps:"
218-
echo " 1. Create a GitHub release with the desired version tag" like `gh release create v0.1.1 lniFFI.xcframework.zip --title "v0.1.1" --notes "Initial release"`
221+
# gh release create v0.1.2 lniFFI.xcframework.zip --title "v0.1.2" --notes "release 3"
222+
echo " 1. Create a GitHub release with the desired version tag"
219223
echo " 2. Upload lniFFI.xcframework.zip to the release"
220224
echo " 3. Update the version in Package.swift URL if needed"
221225

0 commit comments

Comments
 (0)