-
Notifications
You must be signed in to change notification settings - Fork 25
/
justfile
64 lines (46 loc) · 2.85 KB
/
justfile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
default:
just --list
# Build python bindings
# Mac users should either run env.sh or manually set LIB_EXT=dylib
python-build-bindings:
LIBNAME=liblwk.${LIB_EXT:=so} && cargo build --features bindings && cargo run --features bindings -- generate --library target/debug/${LIBNAME} --language python --out-dir target/debug/bindings && cp target/debug/${LIBNAME} target/debug/bindings
python-test-bindings: python-build-bindings
PYTHONPATH=target/debug/bindings/ python3 -c 'import lwk'
python-env-bindings: python-build-bindings
PYTHONPATH=target/debug/bindings/ python3
docker-build:
cd context && docker build . -t xenoky/lwk-builder && cd -
docker-push: docker-build
docker push xenoky/lwk-builder # require credentials
kotlin-android: kotlin android
# Build kotlin interface file `lwk.kt` for bindings
# Mac users should either run env.sh or manually set LIB_EXT=dylib
kotlin:
LIBNAME=liblwk.${LIB_EXT:=so} && cargo build --features bindings && cargo run --features bindings -- generate --library target/debug/${LIBNAME} --language kotlin --out-dir target/release/kotlin
cp -a target/release/kotlin/lwk lwk_bindings/android_bindings/lib/src/main/kotlin
android: aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
cp -a target/release/kotlin/jniLibs lwk_bindings/android_bindings/lib/src/main
aarch64-linux-android:
cargo ndk -t aarch64-linux-android -o target/release/kotlin/jniLibs build -p lwk_bindings
armv7-linux-androideabi:
cargo ndk -t armv7-linux-androideabi -o target/release/kotlin/jniLibs build -p lwk_bindings
i686-linux-android:
cargo ndk -t i686-linux-android -o target/release/kotlin/jniLibs build -p lwk_bindings
x86_64-linux-android:
cargo ndk -t x86_64-linux-android -o target/release/kotlin/jniLibs build -p lwk_bindings
swift: ios ios-sim
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
ios: aarch64-apple-ios
ios-sim: x86_64-apple-ios aarch64-apple-ios-sim
mkdir -p target/lipo-ios-sim/release
lipo target/aarch64-apple-ios-sim/release/liblwk.a target/x86_64-apple-ios/release/liblwk.a -create -output target/lipo-ios-sim/release/liblwk.a
x86_64-apple-ios:
cargo build --release --target x86_64-apple-ios -p lwk_bindings
aarch64-apple-ios:
cargo build --release --target aarch64-apple-ios -p lwk_bindings
aarch64-apple-ios-sim:
cargo build --release --target aarch64-apple-ios-sim -p lwk_bindings