diff --git a/README.md b/README.md index f0793af..5c28811 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ dart run example/main.dart If you have the Rust toolchain installed, the native library will be automatically built by Dart's Native Assets system. As a user of the package, you don't need to worry about building the native library or bindings yourself. Only if you want to contribute to the bindings or modify the native code yourself, you can follow the instructions in [development](#development) below. +The first build can take several minutes depending on your machine and network (subsequent builds are faster). +We currently pin git dependencies to specific commits for reproducibility (including `bdk-ffi` until the next release is cut); the plan is to move to release tags as upstream ships them. ## Development @@ -83,5 +85,5 @@ dart test ## License The Rust crate and generated bindings are dual-licensed under MIT or Apache 2.0 per the -`license = "MIT OR Apache-2.0"` entry in `Cargo.toml`. You may choose either license when +`license = "MIT OR Apache-2.0"` entry in `native/Cargo.toml`. You may choose either license when using the library in your project. diff --git a/example/main.dart b/example/main.dart index ed28d92..30d3b88 100644 --- a/example/main.dart +++ b/example/main.dart @@ -2,11 +2,11 @@ import 'dart:io'; import 'package:bdk_dart/bdk.dart'; -/// Run with: `dart run examples/network_example.dart` +/// Run with: `dart run example/main.dart` /// /// Prerequisites: -/// * Generated bindings (`scripts/generate_bindings.sh`) -/// * Native library (`libbdkffi.*`) discoverable by the Dart process +/// * Rust toolchain available for Native Assets builds. +/// * If you update native bindings, run `bash ./scripts/generate_bindings.sh`. void main() { final network = Network.testnet; diff --git a/justfile b/justfile index 47badbf..8c2ec6a 100644 --- a/justfile +++ b/justfile @@ -11,12 +11,12 @@ repo: [group("Dart")] [doc("Format the Dart codebase.")] format: - dart format . + dart format lib test example bdk_demo/lib bdk_demo/test [group("Dart")] [doc("Run static analysis.")] analyze: - dart analyze + dart analyze --fatal-infos --fatal-warnings lib test example [group("Dart")] [doc("Generate the API documentation.")] @@ -28,6 +28,24 @@ docs: test *ARGS: dart test {{ if ARGS == "" { "" } else { ARGS } }} +[group("Bindings")] +[doc("Build native library and regenerate bindings.")] +generate-bindings: + bash ./scripts/generate_bindings.sh + +[group("Demo")] +[doc("Run Flutter analysis for the demo app.")] +demo-analyze: + cd bdk_demo && flutter analyze + +[group("CI")] +[doc("Run the same checks as CI.")] +ci: + just format + just analyze + just test + just demo-analyze + [group("Dart")] [doc("Remove build and tool artifacts to start fresh.")] clean: @@ -38,4 +56,4 @@ clean: rm -rf bdk_demo/.dart_tool/ rm -rf bdk_demo/build/ rm -rf example/.dart_tool/ - rm -rf example/build/ \ No newline at end of file + rm -rf example/build/ diff --git a/native/Cargo.toml b/native/Cargo.toml index 77b3405..de01dc8 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -17,13 +17,13 @@ name = "uniffi-bindgen" path = "uniffi-bindgen.rs" [dependencies] -bdk-ffi = { package = "bdk-ffi", git = "https://github.com/bitcoindevkit/bdk-ffi.git", branch = "master" } +bdk-ffi = { package = "bdk-ffi", git = "https://github.com/bitcoindevkit/bdk-ffi.git", rev = "6ed0930e3d8ced2ddfd49c6a7bc8a7dec203bb2c" } uniffi = { version = "=0.30.0", features = ["cli"] } -uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart" } +uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart", rev = "5bdcc790c3fc99845e7b4a61d7a4f6e1460896e9" } camino = "1.2" [build-dependencies] uniffi = { version = "=0.30.0", features = ["build"] } -uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart", features = [ +uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart", rev = "5bdcc790c3fc99845e7b4a61d7a4f6e1460896e9", features = [ "build", ] }