This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
35 lines (28 loc) · 2.71 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
STATIC_LIB_NAME := libuniffi_lightwallet_core.a
apple:
@make build-targets
@make bindgen-swift
@make assemble-frameworks
@make xcframework
@make cp-xcframework-source
dev:
sed -i '' 's/= ""/= ".dev"/g' Application/LightWallet/Sources/Commons/configure/Constants.swift
build-targets:
cargo build --release --target x86_64-apple-ios
cargo +nightly build --release --target aarch64-apple-ios-sim
cargo build --release --target aarch64-apple-ios
bindgen-swift:
cargo uniffi-bindgen generate Core/src/LightWalletCore.udl --language swift
sed -i '' 's/module\ LightWalletCoreFFI/framework\ module\ LightWalletCoreFFI/' Core/src/LightWalletCoreFFI.modulemap
assemble-frameworks:
find . -type d -name LightWalletCoreFFI.framework -exec rm -rf {} \; || echo "rm failed"
cd target/x86_64-apple-ios/release && mkdir -p LightWalletCoreFFI.framework && cd LightWalletCoreFFI.framework && mkdir Headers Modules Resources && cp ../../../../Core/src/LightWalletCoreFFI.modulemap ./Modules/module.modulemap && cp ../../../../Core/src/LightWalletCoreFFI.h ./Headers/LightWalletCoreFFI.h && cp ../$(STATIC_LIB_NAME) ./LightWalletCoreFFI && cp ../../../../Core/misc/apple/Info.plist ./Resources
cd target/aarch64-apple-ios-sim/release && mkdir -p LightWalletCoreFFI.framework && cd LightWalletCoreFFI.framework && mkdir Headers Modules Resources && cp ../../../../Core/src/LightWalletCoreFFI.modulemap ./Modules/module.modulemap && cp ../../../../Core/src/LightWalletCoreFFI.h ./Headers/LightWalletCoreFFI.h && cp ../$(STATIC_LIB_NAME) ./LightWalletCoreFFI && cp ../../../../Core/misc/apple/Info.plist ./Resources
cd target/aarch64-apple-ios/release && mkdir -p LightWalletCoreFFI.framework && cd LightWalletCoreFFI.framework && mkdir Headers Modules Resources && cp ../../../../Core/src/LightWalletCoreFFI.modulemap ./Modules/module.modulemap && cp ../../../../Core/src/LightWalletCoreFFI.h ./Headers/LightWalletCoreFFI.h && cp ../$(STATIC_LIB_NAME) ./LightWalletCoreFFI && cp ../../../../Core/misc/apple/Info.plist ./Resources
xcframework:
lipo -create target/x86_64-apple-ios/release/LightWalletCoreFFI.framework/LightWalletCoreFFI target/aarch64-apple-ios-sim/release/LightWalletCoreFFI.framework/LightWalletCoreFFI -output target/aarch64-apple-ios-sim/release/LightWalletCoreFFI.framework/LightWalletCoreFFI
rm -rf target/LightWalletCoreFFI.xcframework || echo "skip removing"
xcodebuild -create-xcframework -framework target/aarch64-apple-ios/release/LightWalletCoreFFI.framework -framework target/aarch64-apple-ios-sim/release/LightWalletCoreFFI.framework -output target/LightWalletCoreFFI.xcframework
cp-xcframework-source:
cp -r target/LightWalletCoreFFI.xcframework Application
cp Core/src/LightWalletCore.swift Application/LightWallet/Sources/Generated