You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR changes `dart build` to have subcommands, so that we can
have different bundle formats in the future.
Moreover, it changes the following:
* `exe` to `cli`. This mirrors `dart create --template cli`
* The output executable no longer has `.exe` on MacOS and Linux.
* The output bundle now contains a `bin/` dir with the executable.
* It removes the `--target-os` option, it would simply error on
cross compilation. (And we don't want API parity with `dart
compile exe`.)
* The default output directory is somewhere in `build/`. This aligns
the behavior with Flutter. (`dart compile` puts the file next to
the Dart file, which is a source directory.)
The executables and dylibs are signed with the ad hoc code signing
`"-"`. Users will need to resign in order to distribute.
New CLI interface:
```
$ dart build cli --help
Build a Dart application for the command line.
The CLI app bundle is structured in the following manner:
bundle/
bin/
<executable>
lib/
<dynamic libraries>
Usage: dart build cli [arguments]
-h, --help Print this usage information.
-o, --output=<path> Write the output to <output>/bundle/.
This can be an absolute or relative path.
(defaults to "build/cli/macos-arm64/")
-t, --target=<path> The main entry-point file of the command-line application.
Must be a Dart file in the bin/ directory.
If the "--target" option is omitted, and there is a single Dart file in bin/,
then that is used instead.
(defaults to "bin/native_add_app.dart")
--verbosity=<level> Sets the verbosity level of the compilation.
[error] Show only error messages
[warning] Show only error and warning messages
[info] Show error, warning, and info messages
[all] (default) Show all messages
```
This PR removes support for `dart build -f exe <target>`, as
`package:args` does not support having subcommands and not
having subcommands: `Could not find a subcommand named
"bin/native_add_app.dart" for "dart build".`
Bug: #60730
Change-Id: I2b527754f3186ec6d0809d7ac45e05984d5c0a02
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433160
Reviewed-by: Michael Goderbauer <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
Commit-Queue: Daco Harkes <[email protected]>
0 commit comments