[prebuilt_code_assets] Distinguish disabled record use from no used functions

The docs and messages said "no recorded uses" for two different cases:

- Record use is disabled (`input.recordedUses` is `null`): it is unknown
  which functions the application uses. They now say "record use is
  disabled".
- The application uses none of the functions: `link` now explicitly
  bundles no library and returns before setting up the linker, instead of
  relying on `CLinker` skipping an empty `symbolsToKeep`. This also holds
  with `treeshake: on`.

Adds unit tests for the second case on Linux and Windows in the `auto` and
`on` modes, and an integration test that a `dart build cli` app that calls
none of the functions runs without the library.
5 files changed
tree: 348cb21ec0444e8ff4edc976a43d1d15b60de911
  1. .agents/
  2. .gemini/
  3. .github/
  4. .idx/
  5. doc/
  6. pkgs/
  7. tool/
  8. .gitignore
  9. analysis_options.yaml
  10. AUTHORS
  11. codecov.yml
  12. CONTRIBUTING.md
  13. LICENSE
  14. pubspec.yaml
  15. README.md
README.md

Coverage Status

Overview

This repository is home to Dart packages related to FFI and native assets building and bundling.

Documentation

See the doc directory for more documentation.

Packages

PackageDescriptionIssuesVersion
code_assetsThis package contains the Dart API for code assets in hook/build.dart and hook/link.dart.issuespub package
data_assetsThis package contains the Dart API for data assets in hook/build.dart and hook/link.dart.issuespub package
ffiUtilities for working with Foreign Function Interface (FFI) code.issuespub package
ffigenGenerator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files.issuespub package
hooksThis package contains the API for hook/build.dart and hook/link.dart.issuespub package
hooks_runnerThis package is the backend that invokes hook/build.dart and hook/link.dart from Dart and Flutter.issuespub package
jniA library to access JNI from Dart and Flutter that acts as a support library for package:jnigen.issuespub package
jni_flutterA library to access Flutter Android specific APIs from Dart.issuespub package
jni_utilA library to access Flutter Android specific APIs from Dart.issuespub package
jnigenA Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine.issuespub package
native_toolchain_cA library to invoke the native C compiler installed on the host machine.issuespub package
objective_cA library to access Objective C from Flutter that acts as a support library for package:ffigen.issuespub package
prebuilt_code_assetsBuild and link hook helpers for packages that ship prebuilt native libraries, with a fallback to building from source and tree-shaking in link hooks.issuespub package
record_useDart API to access @RecordUse() recorded usages in link hooks.issuespub package
swift2objcA tool for generating bindings that allow interop between Dart and Swift code.issuespub package
swiftgenA tool for generating bindings that allow interop between Dart and Swift code.issuespub package

External packages

Packages not on this repo but also related to FFI and native assets. ❤️

PackageDescriptionVersion
native_toolchain_cmakeA library to invoke CMake for Dart Native Assets.pub package
native_toolchain_goA library to invoke the native Go compiler installed on the host machine.pub package
native_toolchain_ninjaA library to invoke Ninja for Dart Native Assets.pub package
native_toolchain_rustA library to build and bundle Rust code for Dart Native Assets.pub package
native_toolchain_zigA library to build and bundle Zig code for Dart Native Assets.pub package

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

For additional information about contributing, see our contributing page.