• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dart-lang / native / 11213684456

07 Oct 2024 10:32AM UTC coverage: 90.469% (-0.5%) from 90.938%
11213684456

push

github

web-flow
Allow custom asset types in the build system (#1623)

This is the first PR that will increase the flexibility of the Dart
Build system as well as makes it more layered. The main points being
addressed in this PR are:

* A bundling tool has to specify which asset types it supports. So we
  make `supportedAssetTypes` required everywhere.
  => Across various layers in the code base we make this required
  => We remove a baked-in `[CodeAsset.type]` fallback in various places
  (Making this explicit increases size of LOCs in this CL due to the
   many tests)

* The core building infrastructure in `pkg/native_assets_builder/lib/*`
  no longer knows anything about `CodeAsset` or `DataAsset`. Instead it
  only knows about `EncodedAsset` which represents the type of an asset
  and it's json encoding.
  => The core still verifies certain protocol consistency (e.g. that a
  hook only emitted asset types that the config allows)
  => The higher levels pass the `supportedAssetTypes`.
  => The higher levels now also pass `buildValidator` / `linkValidator`
  that validate per-asset related things (e.g. the id of a data asset to
  start with the package name) for a given package.
  => The higher levels now also pass a `applicationAssetValidator` that
  validates consistency of assets across all packages (e.g. uniqueness
  of dylib filenames across all dependencies)
  => This centralizes the logic about per-asset-type information in the
  bundling tool (i.e. user of `package:native_assets_builder`).
  => Bundling tools now have to expand `CodeAsset`s in dry-run to all
  architectures.

* The bundling tool (e.g. `flutter build`) doesn't have to implement
  validation logic itself, instead it will support certain asset types
  by importing the "bundling logic" for that asset types (which includes
  - for now - validation logic).

* All the validation code now simply returns `ValidationError` which is
  a list of errors. If the list is e... (continued)

247 of 304 new or added lines in 19 files covered. (81.25%)

13 existing lines in 5 files now uncovered.

10156 of 11226 relevant lines covered (90.47%)

34.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.69
/pkgs/native_assets_cli/lib/src/code_assets/validation.dart


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc