|
1 | 1 | [](https://github.com/dart-lang/native/actions/workflows/dart.yaml) |
2 | | -[](https://pub.dev/packages/native_assets_cli) |
3 | 2 | [](https://coveralls.io/github/dart-lang/native?branch=main) |
4 | | -<!-- [](https://pub.dev/packages/native_assets_cli/publisher) --> |
| 3 | +[](https://pub.dev/packages/native_assets_cli) |
| 4 | +[](https://pub.dev/packages/native_assets_cli/publisher) |
| 5 | + |
| 6 | +This library contains the CLI specification and a default implementation |
| 7 | +for bundling native code with Dart packages. |
| 8 | + |
| 9 | +## Status: Experimental |
| 10 | + |
| 11 | +**NOTE**: This package is currently experimental and published under the |
| 12 | +[labs.dart.dev](https://dart.dev/dart-team-packages) pub publisher in order to |
| 13 | +solicit feedback. |
| 14 | + |
| 15 | +For packages in the labs.dart.dev publisher we generally plan to either graduate |
| 16 | +the package into a supported publisher (dart.dev, tools.dart.dev) after a period |
| 17 | +of feedback and iteration, or discontinue the package. These packages have a |
| 18 | +much higher expected rate of API and breaking changes. |
| 19 | + |
| 20 | +Your feedback is valuable and will help us evolve this package. |
| 21 | +For bugs, please file an issue in the |
| 22 | +[bug tracker](https://github.com/dart-lang/native/issues). |
| 23 | +For general feedback and suggestions for the native assets feature in Dart and |
| 24 | +Flutter, please comment in [dart-lang#50565] or [flutter#129757]. |
| 25 | + |
| 26 | +## Example |
| 27 | + |
| 28 | +A typical layout of a package with native code is: |
| 29 | + |
| 30 | +* `lib/` contains Dart code which uses [`dart:ffi`] and [`package:ffigen`] |
| 31 | + to call into native code. |
| 32 | +* `src/` contains C/C++/Rust code which is invoked through `dart:ffi`. |
| 33 | +* `build.dart` implements the CLI that communicates which native assets |
| 34 | + to build/bundle with the Dart/Flutter SDK. This file uses the |
| 35 | + protocol specified in this package. |
| 36 | + |
| 37 | +An example can be found in [example/](example/). |
| 38 | + |
| 39 | +## Usage |
| 40 | + |
| 41 | +Using the native assets feature requires passing |
| 42 | +`--enable-experiment=native-assets` in Dart on a dev build. |
| 43 | + |
| 44 | +The native assets feature is not yet available in Flutter. |
| 45 | + |
| 46 | +## Development |
| 47 | + |
| 48 | +The development of the feature can be tracked in [dart-lang#50565], |
| 49 | +[flutter#129757], and in the issue tracker on this repository. |
5 | 50 |
|
6 | | -A library that contains the argument and file formats for implementing a native assets CLI. |
| 51 | +[`dart:ffi`]: https://api.dart.dev/stable/dart-ffi/dart-ffi-library.html |
| 52 | +[`package:ffigen`]: https://pub.dev/packages/ffigen |
| 53 | +[dart-lang#50565]: https://github.com/dart-lang/sdk/issues/50565 |
| 54 | +[flutter#129757]: https://github.com/flutter/flutter/issues/129757 |
0 commit comments