-
Notifications
You must be signed in to change notification settings - Fork 4
Update to 2.3.0 alpha.0 with Native Assets #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add patterns for all native binary types (.so, .dylib, .dll, .a) - Remove lib/bdk.dart from .gitignore to include in published package
Generated bindings are now tracked in version control to enable publishing to pub.dev. Users should not need to generate bindings themselves when installing the package.
…fork - Bump version to 2.3.0-alpha.0 - Upgrade uniffi from 0.29.4 to 0.30.0 - Switch to kumulynja/uniffi-dart fork - Add camino dependency for uniffi 0.30.0 compatibility - Update bdk_kyoto from 0.15.1 to 0.15.3
- Use placeholder UDL path (metadata extracted from library) - Auto-detect library file by extension instead of --library flag - Use camino::Utf8Path required by uniffi 0.30.0 - Simplify code with match expression
- Add path variables for cleaner navigation - Add submodule init/update and version checkout - Remove manual fat binary creation (handled by Native Assets) - Add rsync to copy bdk-ffi source to native/ for publishing - Update to work with uniffi 0.30.0 library mode
Add hook/build.dart to compile native libraries automatically for the\ user's platform during dart/flutter pub get, eliminating manual build\ steps for users and the need to manage pre-compiled binaries.
|
@Johnosezele if you can review this too |
|
@reez @Johnosezele Don't be scared by the big number of files changed, you don't have to review the |
Sure! |
|
side note: ci on repo passes now via #11 not sure if you need to rebase on that and/or if we can get this PR ci passing even though it targets 0.30.0 |
|
I really like the ideas in this pr, but as I've been looking at this pr more I think things would be clearer as separate PRs, as an example splitting things like these out from each other:
Thoughts? |
Yes, although I think there is not much done around migration to uniffi v0.30.0 specifically in this PR other than using bdk-ffi v2.3.0-alpha, which is the first bdk-ffi version using uniffi v0.30.0 if I am not mistaken. Most (if not all) of the migration work is done in bdk-ffi for that. The reason why I needed that is because the version of uniffi-dart that has Native Assets support doesn't work for < 0.30.0, and this PR actually is more (pretty much completely) about setting bdk-dart up for Native Assets support and so to avoid needing to have platform specific code or binary publishing/binding. So yeah, not sure if you want to have bdk-ffi-v2.3.0-alpha working without Native Assets first as well? |
This PR updates bdk dart to v2.3.0-alpha.0 which uses uniffi 0.30, and it uses a fork that refactors uniffi-dart to use Native Assets instead of needing to open the libs on a specific path. This means a build hook could be used in bdk-dart and no precompiled binaries are needed anymore and the package can be published to pub.dev like this. Native Assets is the new and recommended way in Dart and Flutter to use native libraries.
It required some "hacks" in
generate_bindings.shthat could be solved if some adjustments inbdk-ffiare made, but it are minor things.I added a pure dart CLI package as example next to the other examples folder and bdk_demo folder, all three work out-of-the-box. Just run
flutter/dart pub getandflutter/dart runand it should. In the bdk_demo app you can press the "Get Signet Network" button and this should print a mnemonic in the console using bdk-dart bindings.