diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 7fb1b2452..5549852b4 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -43,6 +43,9 @@ jobs: - uses: dtolnay/rust-toolchain@1.85.0 with: targets: x86_64-apple-ios,aarch64-apple-ios,aarch64-apple-ios-sim,aarch64-apple-darwin + - uses: nightstory/setup-xcodegen@v1 + with: + version: 'latest' - uses: extractions/setup-just@v2 with: just-version: 1.5.0 # optional semver specification, otherwise latest diff --git a/justfile b/justfile index fcc054c6d..7caca973c 100644 --- a/justfile +++ b/justfile @@ -125,10 +125,10 @@ aarch64-apple-ios-sim: swift: ios ios-sim # we are not using build-bindings-lib because we need the mac targets anyway cargo run --features bindings -- generate --library ./target/aarch64-apple-ios/release/liblwk.a --language swift --out-dir ./target/swift - mkdir -p ./target/swift/include - mv target/swift/lwkFFI.h target/swift/include - mv target/swift/lwkFFI.modulemap target/swift/include/module.modulemap - xcodebuild -create-xcframework -library target/lipo-ios-sim/release/liblwk.a -headers target/swift/include -library target/aarch64-apple-ios/release/liblwk.a -headers target/swift/include -output target/lwkFFI.xcframework + xcodegen generate --spec lwk_bindings/swift/project.yml + xcodebuild archive -project lwk_bindings/swift/LwkBindings.xcodeproj -scheme lwkFFI -archivePath "./target/ios.xcarchive" -sdk iphoneos -destination "generic/platform=iOS" + xcodebuild archive -project lwk_bindings/swift/LwkBindings.xcodeproj -scheme lwkFFI -archivePath "./target/ios_sim.xcarchive" -sdk iphonesimulator -destination "generic/platform=iOS Simulator" + xcodebuild -create-xcframework -framework "./target/ios.xcarchive/Products/Library/Frameworks/lwkFFI.framework" -framework "./target/ios_sim.xcarchive/Products/Library/Frameworks/lwkFFI.framework" -output "./target/lwkFFI.xcframework" csharp-windows: build-bindings-lib cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.10.0+v0.29.4 diff --git a/lwk_bindings/swift/project.yml b/lwk_bindings/swift/project.yml new file mode 100644 index 000000000..23ea4df2d --- /dev/null +++ b/lwk_bindings/swift/project.yml @@ -0,0 +1,27 @@ +name: LwkBindings +options: + bundleIdPrefix: com.blockstream +targets: + lwkFFI: + type: framework + platform: iOS + deploymentTarget: "13.0" + settings: + MACH_O_TYPE: staticlib + GENERATE_MASTER_OBJECT_FILE: YES + GENERATE_INFOPLIST_FILE: YES + STRIP_INSTALLED_PRODUCT: NO + BUILD_LIBRARIES_FOR_DISTRIBUTION: YES + SKIP_INSTALL: NO + DEFINES_MODULE: YES + ENABLE_BITCODE: NO + # Conditional paths: + "LIBRARY_SEARCH_PATHS[sdk=iphoneos*]": "../../target/aarch64-apple-ios/release" + "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]": "../../target/lipo-ios-sim/release" + sources: + - path: "../../target/swift/lwkFFI.h" + headerVisibility: public + dependencies: + # Link the library name. Xcode will look in the search paths defined above. + - framework: liblwk.a + embed: false \ No newline at end of file