Skip to content

Commit

Permalink
Update old dart2native mentions (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough authored Nov 4, 2023
1 parent 65044c7 commit 59b4538
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion command_line/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 12 additions & 8 deletions native_app/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -23,6 +25,7 @@ To run:
```

### Windows

To build the executable:

```bash
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion native_app/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 59b4538

Please sign in to comment.