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

dart-lang / native / 11075701623
92%

Build:
DEFAULT BRANCH: main
Ran 27 Sep 2024 06:20PM UTC
Jobs 9
Files 69
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Sep 2024 06:18PM UTC coverage: 92.22% (-0.1%) from 92.361%
11075701623

push

github

web-flow
Unify {OS,Architecture,...} and {OS,Architecture,...}Impl classes that are effectively simple enums or data classes (#1604)

The API of `package:native_assets_cli` uses currently a
one-size-fits-all approach:

* almost every API class has two versions a `<Foo>` and a `<Foo>Impl`
* `package:native_assets_cli/native_assets_cli.dart` exposes `<Foo>`
* `package:native_assets_cli/native_assets_cli_internal.dart` exposes `<Foo>Impl`

This has a number of issues

* The `_internal.dart` is actually a public API: It's used e.g. by
  flutter tools and breaking changes to it need major version bumps.

* A user of the `<Foo>` API doesn't know that such objects are for
  example
    * hashable (e.g. go-to-definition to `<Foo>` there's no
      indication of that), e.g. `DynamicLoadingSystem` makes no mention
      of it, no `get hashCode` override, ... only in
      `DynamicLoadingSystemImpl` there is.
    * have a `toString()` that code can rely on the returned string not
      changing
    * ...

* It causes code to have to choose between e.g. `OS` and `OSImpl` -
  which is very confusing as it's just one concept.

* It causes code to have to downcast e.g. `os as OSImpl`.
  => This is a very bad smell, as generally it's an unsafe operation to
  downcast.

* It's code duplication across the api/ and model/ folders, make it
  harder to navigate in codebase (as one may have to constantly switch
  between the files), ...

One original intention for this separation may have been to hide all traces
of the json protocol in the non-internal version, but I think this is not
needed at all, because the protocol itself will be *more* stable than the APIs
offered by the package itself (much easier to break the Dart API and publish and
new version of the package than to break the CLI protocol).

=> So this PR starts to merge some `<Foo>` and `<Foo>Impl` classes into
one `<Foo>`.
=> This simplifies the code, removes `as ...Impl` downcas... (continued)

169 of 172 new or added lines in 12 files covered. (98.26%)

2513 of 2725 relevant lines covered (92.22%)

38.75 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
90.38
-0.07% pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart
1
97.5
pkgs/native_assets_cli/lib/src/link_mode.dart
1
88.72
-0.86% pkgs/native_assets_cli/lib/src/model/hook_config.dart
Subprojects
ID Flag name Job ID Ran Files Coverage
1 native_assets_builder_windows 11075701623.1 27 Sep 2024 06:25PM UTC 10
87.2
GitHub Action Run
2 native_assets_cli_ubuntu 11075701623.2 27 Sep 2024 06:20PM UTC 35
90.45
GitHub Action Run
3 native_toolchain_c_windows 11075701623.3 27 Sep 2024 06:22PM UTC 24
78.31
GitHub Action Run
4 native_assets_builder_macos 11075701623.4 27 Sep 2024 06:23PM UTC 10
87.2
GitHub Action Run
5 native_assets_builder_ubuntu 11075701623.5 27 Sep 2024 06:23PM UTC 10
87.2
GitHub Action Run
6 native_toolchain_c_ubuntu 11075701623.6 27 Sep 2024 06:20PM UTC 24
74.42
GitHub Action Run
7 native_assets_cli_macos 11075701623.7 27 Sep 2024 06:20PM UTC 35
90.82
GitHub Action Run
8 native_toolchain_c_macos 11075701623.8 27 Sep 2024 06:21PM UTC 24
69.6
GitHub Action Run
9 native_assets_cli_windows 11075701623.9 27 Sep 2024 06:20PM UTC 35
90.17
GitHub Action Run
Source Files on build 11075701623
  • Tree
  • List 69
  • Changed 10
  • Source Changed 10
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11075701623
  • 1aae9dab on github
  • Prev Build on main (#11072475500)
  • Next Build on main (#11087994061)
  • Delete
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

© 2025 Coveralls, Inc