File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ doc/api/
55
66.DS_Store
77
8+ # Auto-generated shared libraries
9+ * .dylib
10+ * .so
11+ * .dll
12+
813# Auto-generated bindings
914lib /payjoin_ffi.dart
1015lib /bitcoin.dart
Original file line number Diff line number Diff line change 1+
2+
3+ #! /bin/bash
4+ chmod +x ./scripts/generate_linux.sh
5+ chmod +x ./scripts/generate_macos.sh
6+
7+
8+ # Run each script
9+ scripts/generate_linux.sh
10+ scripts/generate_macos.sh
11+
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+ LIBNAME=libpayjoin_ffi.so
4+ LINUX_TARGET=x86_64-unknown-linux-gnu
5+
6+ echo " Generating payjoin_ffi.dart..."
7+ cd ../
8+ # This is a test script the actual release should not include the test utils feature
9+ cargo build --profile release --features uniffi,_test-utils
10+ cargo run --profile release --features uniffi,_test-utils --bin uniffi-bindgen -- --library target/release/$LIBNAME --language dart --out-dir dart/lib/
11+
12+ echo " Generating native binaries..."
13+ rustup target add $LINUX_TARGET
14+ # This is a test script the actual release should not include the test utils feature
15+ cargo build --profile release-smaller --target $LINUX_TARGET --features uniffi,_test-utils
16+
17+ echo " Copying linux payjoin_ffi.so"
18+ cp target/$LINUX_TARGET /release-smaller/$LIBNAME dart/$LIBNAME
19+
20+ echo " All done!"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+ LIBNAME=libpayjoin_ffi.dylib
5+
6+ echo " Generating payjoin_ffi.dart..."
7+ cd ../
8+ # This is a test script the actual release should not include the test utils feature
9+ cargo build --features uniffi,_test-utils --profile release
10+ cargo run --features uniffi,_test-utils --profile release --bin uniffi-bindgen -- --library target/release/$LIBNAME --language dart --out-dir dart/lib/
11+
12+ echo " Generating native binaries..."
13+ rustup target add aarch64-apple-darwin x86_64-apple-darwin
14+
15+ # This is a test script the actual release should not include the test utils feature
16+ cargo build --profile release-smaller --target aarch64-apple-darwin --features uniffi,_test-utils
17+ echo " Done building aarch64-apple-darwin"
18+
19+ # This is a test script the actual release should not include the test utils feature
20+ cargo build --profile release-smaller --target x86_64-apple-darwin --features uniffi,_test-utils
21+ echo " Done building x86_64-apple-darwin"
22+
23+ echo " Building macos fat library"
24+
25+ lipo -create -output dart/$LIBNAME \
26+ target/aarch64-apple-darwin/release-smaller/$LIBNAME \
27+ target/x86_64-apple-darwin/release-smaller/$LIBNAME
28+
29+ echo " All done!"
You can’t perform that action at this time.
0 commit comments