mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-18 14:34:24 +01:00
108 lines
3.1 KiB
Makefile
108 lines
3.1 KiB
Makefile
curr_version := "breez_liquid-v" + `awk '/^version: /{print $2}' ../../../../packages/flutter/pubspec.yaml`
|
|
frb_bin := "flutter_rust_bridge_codegen generate"
|
|
|
|
export CARGO_TERM_COLOR := "always"
|
|
|
|
# Lists available recipes
|
|
default:
|
|
just --list --unsorted
|
|
|
|
# Initializes the workspace
|
|
bootstrap frb='true' build='false':
|
|
just clean
|
|
@if {{frb}} == true; then just frb; fi
|
|
just init
|
|
@if {{build}} == true; then just build; fi
|
|
just check
|
|
|
|
# (melos) Cleans the current workspace and all its packages of temporary pub & generated Melos IDE files.
|
|
clean:
|
|
melos clean
|
|
|
|
# Install flutter_rust_bridge_codegen dependencies
|
|
frb:
|
|
# This is locked plist PR https://github.com/ebarnard/rust-plist/pull/152 is merged/released
|
|
cargo install cargo-expand --locked
|
|
cargo install flutter_rust_bridge_codegen --version 2.9.0
|
|
dart pub global activate ffigen
|
|
dart pub global activate ffi
|
|
cargo install cargo-xcode
|
|
|
|
# (melos) use instead of flutter pub get
|
|
init *args:
|
|
dart pub global activate melos
|
|
melos bootstrap {{args}}
|
|
melos pub-upgrade
|
|
just init-sdk
|
|
|
|
# Install Breez Liquid SDK dependencies
|
|
init-sdk:
|
|
brew install protobuf
|
|
|
|
# Builds the uniFFI library & Generates Dart/Flutter bindings
|
|
build:
|
|
just build-uniffi
|
|
just gen
|
|
|
|
# Builds the uniFFI library
|
|
build-uniffi:
|
|
just build-uniffi-android
|
|
just build-uniffi-swift
|
|
|
|
# Builds the uniFFI library for Android
|
|
build-uniffi-android:
|
|
bash scripts/build_uniffi_android.sh
|
|
|
|
# Builds the uniFFI library for Swift
|
|
build-uniffi-swift:
|
|
bash scripts/build_uniffi_swift.sh
|
|
|
|
# Generate Dart/Flutter bindings & Softlinks C headers
|
|
gen ios='true':
|
|
just codegen
|
|
@if {{ios}} == true; then just build-ios-framework; fi
|
|
just ffigen
|
|
|
|
# Generate Dart/Flutter bindings & softlinks C headers
|
|
codegen:
|
|
mkdir -p ../../../../packages/dart/lib/src
|
|
{{frb_bin}}
|
|
cd ../../../../packages/dart/lib/src && dart format -l 110 .
|
|
-ln -sf $(pwd)/breez_sdk_liquid/include/breez_sdk_liquid.h ../../../../packages/flutter/ios/Classes/breez_sdk_liquid.h
|
|
-ln -sf $(pwd)/breez_sdk_liquid/include/breez_sdk_liquid.h ../../../../packages/flutter/macos/Classes/breez_sdk_liquid.h
|
|
|
|
# Builds the uniFFI framework & softlinks C headers
|
|
build-ios-framework:
|
|
bash scripts/build_ios_framework.sh
|
|
-ln -sf $(pwd)/breez_sdk_liquidFFI/include/breez_sdk_liquidFFI.h ../../../../packages/flutter/ios/Classes/breez_sdk_liquidFFI.h
|
|
-ln -sf $(pwd)/breez_sdk_liquidFFI/include/breez_sdk_liquidFFI.h ../../../../packages/flutter/macos/Classes/breez_sdk_liquidFFI.h
|
|
|
|
# Generate FFI bindings
|
|
ffigen:
|
|
cd ../../../../packages/flutter/ && dart run ffigen --config ffigen.yaml && dart format -l 110 ./lib/flutter_breez_liquid_bindings_generated.dart
|
|
|
|
# (melos) Analyze & check the format of packages in workspace
|
|
check:
|
|
melos analyze
|
|
melos check-format
|
|
|
|
# Update version number on podspec files & CMake scripts
|
|
version:
|
|
bash scripts/version.sh
|
|
|
|
# (melos) Run tests on packages in workspace
|
|
test build='false':
|
|
just test-dart {{build}}
|
|
|
|
# (melos) Run tests on Dart packages in workspace
|
|
test-dart build='true':
|
|
@if {{build}} == true; then just build; fi
|
|
melos test-dart
|
|
|
|
# (melos) Generate docs for packages in workspace
|
|
docs:
|
|
melos docs
|
|
|
|
# Open melos.yaml
|
|
melos:
|
|
@$EDITOR melos.yaml
|