build: migrate uniffi bindings files generation to library mode

This commit is contained in:
thunderbiscuit
2024-04-30 15:54:50 -04:00
parent 5557bb94ea
commit 330dc96b8a
7 changed files with 32 additions and 27 deletions

View File

@@ -4,15 +4,16 @@ set -euo pipefail
python3 --version
pip install -r requirements.txt
echo "Generating bdk.py..."
cd ../bdk-ffi/
rustup default 1.77.1
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
rustup target add x86_64-pc-windows-msvc
echo "Generating native binaries..."
rustup target add x86_64-pc-windows-msvc
cargo build --profile release-smaller --target x86_64-pc-windows-msvc
echo "Generating bdk.py..."
cargo run --bin uniffi-bindgen generate --library ./target/x86_64-pc-windows-msvc/release-smaller/bdkffi.dll --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
echo "Copying libraries bdkffi.dll..."
cp ./target/x86_64-pc-windows-msvc/release-smaller/bdkffi.dll ../bdk-python/src/bdkpython/bdkffi.dll