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

dart-lang / native / 11662782319

04 Nov 2024 10:52AM UTC coverage: 90.492% (-0.4%) from 90.875%
11662782319

push

github

web-flow
Allow custom build/link configuration, decouple core CLI infrastructure from code assets, data assets, ... (#1643)

This PR allows users of `package:native_assets_builder` to supply custom
build/link configuration. This allows e.g. flutter to add additional
configuration to `hook/{build,link}.dart` scripts that require flutter
specific things.

As opposed to earlier PRs that merged `Foo` and `FooImpl` we have a
different approach for build/link config/output as they are something
different:

The current API (even before the recent refactoring to it) allows read
and write access to (e.g. assets, ...). We remove this capability as this
is conceptually problematic:

- Currently those API classes are both mutable and at the same time
  support operator==/hashCode:
  => This is problematic as inserting such an object into a set/map and
  then modifying it means one can later on not find it anymore. Mutable
  objects can have operator==/hashCode iff it doesn't change (e.g. the
  default implementation based on identity). Otherwise objects should be
  immutable if they want to support operator==/hashCode.
  => For our purposes we have no need for operator==/hashCode and
  therefore remove this (problematic) capability.

- Currently those API classes are serving both the hook writers and the
  bundling tool. The bundling tool would use `...Impl` versions of those, but
  in the end operate on the same structures.

We now change this to be using the builder pattern: The code that
  * creates build/link config/output will use a builder object that allows
    write/mutation only

  * consumes build/link config/output will uses a view object that only
    allows read access

We then make those build/link config/output objects flexible in the
sense that

  * a bundling tool can add more configuration to build/link
    configuration
  * a hook can consume this additional configuration

To support this we

a) Make the builde... (continued)

446 of 529 new or added lines in 18 files covered. (84.31%)

39 existing lines in 9 files now uncovered.

11154 of 12326 relevant lines covered (90.49%)

34.7 hits per line

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

81.91
/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