diff --git a/README.md b/README.md index 3602f38..6e065a6 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Dart][awesome-dart]. the main isolate. - [native_app](https://github.com/dart-lang/samples/tree/main/native_app) - A command line application that can be compiled to native code using - `dart2native`. + `dart compile exe`. - [server](https://github.com/dart-lang/samples/tree/main/server) - Examples of running Dart on the server. - [package_constraint_solver](https://github.com/dart-lang/samples/tree/main/package_constraint_solver) - Demonstrates best-practices for publishing packages on pub.dev. diff --git a/command_line/pubspec.yaml b/command_line/pubspec.yaml index 61023c3..021fce4 100644 --- a/command_line/pubspec.yaml +++ b/command_line/pubspec.yaml @@ -1,7 +1,7 @@ name: cli_app description: > A command line application that can be compiled to native code using - dart2native. + dart compile exe. # This example isn't intended for publishing on pub.dev. publish_to: none diff --git a/native_app/README.md b/native_app/README.md index 01eb85d..05fe48c 100644 --- a/native_app/README.md +++ b/native_app/README.md @@ -1,15 +1,17 @@ # Native compilation sample This sample is a command line application that can be compiled to native code -using the [`dart2native`][dart2native] command included in Dart 2.6. +using the [`dart compile exe`][exe] command. ## Building and running an executable -To create a standalone executable, run the `dart2native` command on a Dart file -with a `main()` function. By default, it places the executable in the same -directory. The `--output` or `-o` flag is used to change the location of the -executable. + +To create a standalone executable, run the `dart compile exe` command on +a Dart file with a `main()` function. +By default, it places the executable in the same directory. +The `--output` or `-o` flag is used to change the location of the executable. ### Linux and macOS + To build the executable: ```bash @@ -23,6 +25,7 @@ To run: ``` ### Windows + To build the executable: ```bash @@ -36,7 +39,8 @@ hello_world.exe ``` ## Building an AOT snapshot -The `--output-kind` or `-k` flag can be used to create an AOT snapshot: + +The `--output-kind` or `-k` flag can be used to create an [AOT snapshot][]: ```bash dart compile aot-snapshot bin/main.dart -o hello_world.aot @@ -48,5 +52,5 @@ This AOT snapshot can be run using the `dartaotruntime` command: dartaotruntime hello_world.aot ``` -[dart2native]: https://dart.dev/tools/dart2native -[snapshots]: https://github.com/dart-lang/sdk/wiki/Snapshots +[exe]: https://dart.dev/tools/dart-compile#exe +[AOT snapshot]: https://dart.dev/tools/dart-compile#aot-snapshot diff --git a/native_app/pubspec.yaml b/native_app/pubspec.yaml index 2047ab5..4f5cf91 100644 --- a/native_app/pubspec.yaml +++ b/native_app/pubspec.yaml @@ -1,7 +1,7 @@ name: native_app description: > A command line application that can be compiled to native code using - dart2native. + dart compile exe. # This example isn't intended for publishing on pub.dev. publish_to: none