mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-24 16:34:20 +01:00
Add bash script counterpart of linux/windows targets build script
! This script is not being used by Melos and is added for local testing !
This commit is contained in:
50
lib/bindings/bindings-flutter/scripts/build_other.sh
Normal file
50
lib/bindings/bindings-flutter/scripts/build_other.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ! This script is not being used by Melos and is added for local testing !
|
||||
|
||||
# Setup
|
||||
BUILD_DIR=platform-build
|
||||
mkdir $BUILD_DIR
|
||||
cd $BUILD_DIR
|
||||
|
||||
# Install build dependencies
|
||||
cargo install cargo-zigbuild
|
||||
cargo install cargo-xwin
|
||||
|
||||
zig_build () {
|
||||
local TARGET="$1"
|
||||
local PLATFORM_NAME="$2"
|
||||
local LIBNAME="$3"
|
||||
local PROFILE="$4"
|
||||
rustup target add "$TARGET"
|
||||
cargo zigbuild --package breez-liquid-sdk --target "$TARGET" --profile $PROFILE
|
||||
mkdir "$PLATFORM_NAME"
|
||||
cp "../../../target/$TARGET/$PROFILE/$LIBNAME" "$PLATFORM_NAME/"
|
||||
}
|
||||
|
||||
win_build () {
|
||||
local TARGET="$1"
|
||||
local PLATFORM_NAME="$2"
|
||||
local LIBNAME="$3"
|
||||
local PROFILE="$4"
|
||||
rustup target add "$TARGET"
|
||||
cargo xwin build --package breez-liquid-sdk --target "$TARGET" --profile $PROFILE
|
||||
mkdir "$PLATFORM_NAME"
|
||||
cp "../../../target/$TARGET/$PROFILE/$LIBNAME" "$PLATFORM_NAME/"
|
||||
}
|
||||
|
||||
PROFILE=frb-min
|
||||
# Build all the dynamic libraries
|
||||
LIBNAME=breez_liquid_sdk
|
||||
LINUX_LIBNAME=lib$LIBNAME.so
|
||||
zig_build aarch64-unknown-linux-gnu linux-arm64 $LINUX_LIBNAME $PROFILE
|
||||
zig_build x86_64-unknown-linux-gnu linux-x64 $LINUX_LIBNAME $PROFILE
|
||||
WINDOWS_LIBNAME=$LIBNAME.dll
|
||||
win_build aarch64-pc-windows-msvc windows-arm64 $WINDOWS_LIBNAME $PROFILE
|
||||
win_build x86_64-pc-windows-msvc windows-x64 $WINDOWS_LIBNAME $PROFILE
|
||||
|
||||
# Archive the dynamic libs
|
||||
tar -czvf other.tar.gz linux-* windows-*
|
||||
|
||||
# Cleanup
|
||||
rm -rf linux-* windows-*
|
||||
Reference in New Issue
Block a user