Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
6 changes: 3 additions & 3 deletions example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
24 changes: 21 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.")]
Expand All @@ -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:
Expand All @@ -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/
rm -rf example/build/
6 changes: 3 additions & 3 deletions native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
] }