mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-29 11:54:26 +01:00
96 lines
2.9 KiB
Makefile
96 lines
2.9 KiB
Makefile
curr_version := "breez_liquid-v" + `awk '/^version: /{print $2}' ../../../packages/dart/pubspec.yaml`
|
|
frb_bin := "flutter_rust_bridge_codegen generate"
|
|
|
|
export CARGO_TERM_COLOR := "always"
|
|
|
|
default:
|
|
just --list --unsorted
|
|
|
|
# Initializes the workspace
|
|
bootstrap frb='true':
|
|
just clean
|
|
@if {{frb}} == true; then just frb; fi
|
|
just init
|
|
just gen
|
|
just build
|
|
just link
|
|
just check
|
|
|
|
# Install flutter_rust_bridge_codegen dependencies
|
|
frb:
|
|
cargo install cargo-expand
|
|
cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.33
|
|
dart pub global activate ffigen
|
|
dart pub global activate ffi
|
|
cargo install cargo-xcode
|
|
|
|
# Generate bindings
|
|
gen: codegen && ffigen
|
|
|
|
# Generate Dart/Flutter bindings && softlink C headers
|
|
codegen:
|
|
{{frb_bin}}
|
|
-ln -sf $(pwd)/breez_liquid_sdk/include/breez_liquid_sdk.h ../../../packages/flutter/ios/Classes/breez_liquid_sdk.h
|
|
-ln -sf $(pwd)/breez_liquid_sdk/include/breez_liquid_sdk.h ../../../packages/flutter/macos/Classes/breez_liquid_sdk.h
|
|
|
|
# Generate FFI bindings
|
|
ffigen:
|
|
cd ../../../packages/flutter/ && flutter pub run ffigen --config ffigen.yaml && cd ..
|
|
|
|
# Builds the local library for testing
|
|
build *args:
|
|
cargo build --package breez-liquid-sdk --manifest-path ../../core/Cargo.toml --features frb {{args}}
|
|
|
|
build-apple *args:
|
|
dart scripts/build_apple.dart {{args}}
|
|
|
|
build-android profile='release':
|
|
bash scripts/build-android.sh {{profile}}
|
|
|
|
build-other *args:
|
|
dart scripts/build_other.dart {{args}}
|
|
|
|
# (melos) Run tests on packages in workspace
|
|
test build='false':
|
|
just test-dart {{build}}
|
|
# test-flutter {{build}}
|
|
|
|
# (melos) Run tests on Dart packages in workspace
|
|
test-dart build='true':
|
|
@if {{build}} == true; then just build; fi
|
|
melos test-dart
|
|
|
|
# (melos) Run integration tests on Flutter packages in workspace
|
|
#test-flutter build='true':
|
|
# @if {{build}} == true; then build; fi
|
|
# melos test-flutter
|
|
|
|
# Softlinks library archives from platform-build to their expected locations
|
|
link:
|
|
-ln -sf $(pwd)/platform-build/breez_liquid_sdk.xcframework.zip ../../../packages/flutter/macos/Frameworks/{{curr_version}}.zip
|
|
-ln -sf $(pwd)/platform-build/breez_liquid_sdk.xcframework.zip ../../../packages/flutter/ios/Frameworks/{{curr_version}}.zip
|
|
-ln -sf $(pwd)/platform-build/other.tar.gz ../../../packages/flutter/linux/{{curr_version}}.tar.gz
|
|
-ln -sf $(pwd)/platform-build/other.tar.gz ../../../packages/flutter/windows/{{curr_version}}.tar.gz
|
|
-ln -sf $(pwd)/platform-build/android.tar.gz ../../../packages/flutter/android/{{curr_version}}.tar.gz
|
|
|
|
# (melos) use instead of flutter pub get
|
|
init *args:
|
|
dart pub global activate melos
|
|
melos bootstrap {{args}}
|
|
|
|
# (melos) Generate docs for packages in workspace
|
|
docs:
|
|
melos docs
|
|
|
|
# (melos) Cleans the current workspace and all its packages of temporary pub & generated Melos IDE files.
|
|
clean:
|
|
melos clean
|
|
|
|
# (melos) Analyze & check the format of packages in workspace
|
|
check:
|
|
melos analyze
|
|
melos check-format
|
|
|
|
# Open melos.yaml
|
|
melos:
|
|
@$EDITOR melos.yaml
|