Files
breez-sdk-liquid/lib/bindings/langs/flutter/justfile
Erdem Yerebasmaz 1695c88d9c Update flutter_rust_bridge to 2.7.0 (#642)
* Suppress no-nullability-completeness errors

* Use 'dart run' instead of the deprecated 'flutter pub run' cmd

* Update flutter_rust_bridge to version 2.7.0

Set flutter_rust_bridge range to ">=2.4.0 <=2.7.0" on Dart plugin.

* Generate Dart bindings

* Update Flutter to latest version

* Update melos to latest version

* Make Flutter plugin compatible with AGP 8.+

- Declare 'namespace' property on module-level build script
  - Change default namespace
  - Remove package name from AndroidManifest
- Bump compileSdkVersion to latest
- Update source and target compatibility

warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
2025-01-07 14:03:08 +03:00

107 lines
3.0 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:
cargo install cargo-expand
cargo install flutter_rust_bridge_codegen --version 2.7.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