Files
sdk/pkg/native_assets_builder
Nate Bosch 1284d79dfe Handle errors from process output
Remove the `stderrCompleter` and `stdoutCompleter` variables in favor of
holding the `StreamSubscription` and using `asFuture()`. This ensures
that any errors from the stream (for instance UTF8 decodign errors) are
captured by the awaited `Future` instead of bubbling up as unhandled
async errors.

Use the `.wait` extension for records so error handlers are eagerly
added for the `exitCode` and output futures instead of not listening to
the other futures until after the exit code has completed, and errors
may have already bubbled up unhandled.

Also refactor the use of a map literal - don't use an extra `...{}`
literal, move the for-in element to the outer collection literal and use
`...?` over a conditional element with a null check. Skip the extra
intermediate variable `newEnvironment`.

Check `captureOutput` eagerly and avoid a closure in favor of a tear-off
when it is false. When the logger is null this allows an ignorable
`null` callback instead of always invoking a callback that does nothing.

Change-Id: Iebecd5e9c11526c67d6f0c181ee948118698360a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307721
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2023-06-08 19:50:36 +00:00
..
2023-06-08 19:50:36 +00:00

This package contains the logic for building native assets.

This package is the backend that invokes toplevel build.dart scripts. For more info on these scripts see https://github.com/dart-lang/native.

This is a separate package so that dartdev and flutter_tools can reuse the same logic with flutter_tools having to import dartdev.