From 6fd8531b1a3f73baffdc9cadcd92a358eea274ff Mon Sep 17 00:00:00 2001 From: Luca Vaccaro Date: Thu, 9 Apr 2026 01:47:47 +0200 Subject: [PATCH] task: update xcframework and support legacy ios sim Signed-off-by: Luca Vaccaro --- build/.tasks.yml | 13 ++++++++----- build/project.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 build/project.yml diff --git a/build/.tasks.yml b/build/.tasks.yml index 8bcd4e3c..e272fb03 100644 --- a/build/.tasks.yml +++ b/build/.tasks.yml @@ -37,7 +37,10 @@ tasks: - ios-sim cmds: - cargo run --bin uniffi-bindgen -- generate --library ./target/aarch64-apple-ios/release/libglsdk.a --language swift --out-dir ./target/swift - - xcodebuild -create-xcframework -library target/aarch64-apple-ios-sim/release/libglsdk.a -library target/aarch64-apple-ios/release/libglsdk.a -output target/glsdkFFI.xcframework + - xcodegen generate --spec build/project.yml --project ./libs/gl-sdk-swift + - xcodebuild archive -project libs/gl-sdk-swift/GreenlightBindings.xcodeproj -scheme glsdkFFI -archivePath "./target/ios.xcarchive" -sdk iphoneos -destination "generic/platform=iOS" + - xcodebuild archive -project libs/gl-sdk-swift/GreenlightBindings.xcodeproj -scheme glsdkFFI -archivePath "./target/ios_sim.xcarchive" -sdk iphonesimulator -destination "generic/platform=iOS Simulator" + - xcodebuild -create-xcframework -framework "./target/ios.xcarchive/Products/Library/Frameworks/glsdkFFI.framework" -framework "./target/ios_sim.xcarchive/Products/Library/Frameworks/glsdkFFI.framework" -output "./target/glsdkFFI.xcframework" linux-*-*: vars: @@ -53,10 +56,10 @@ tasks: ios-sim: deps: - ios-sim-apple-aarch64 -# - ios-apple-x86_64 -# cmds: -# - mkdir -p target/lipo-ios-sim/release -# - lipo -create target/aarch64-apple-ios-sim/release/libglsdk.a target/x86_64-apple-ios/release/libglsdk.a -output target/lipo-ios-sim/release/libglsdk.a + - ios-apple-x86_64 + cmds: + - mkdir -p target/lipo-ios-sim/release + - lipo -create target/aarch64-apple-ios-sim/release/libglsdk.a target/x86_64-apple-ios/release/libglsdk.a -output target/lipo-ios-sim/release/libglsdk.a ios-apple-*: vars: diff --git a/build/project.yml b/build/project.yml new file mode 100644 index 00000000..9815d993 --- /dev/null +++ b/build/project.yml @@ -0,0 +1,27 @@ +name: GreenlightBindings +options: + bundleIdPrefix: com.blockstream +targets: + glsdkFFI: + 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/glsdkFFI.h" + headerVisibility: public + dependencies: + # Link the library name. Xcode will look in the search paths defined above. + - framework: libglsdk.a + embed: false \ No newline at end of file