A tool for packaging Dart programs into standalone executables.
- Go SDK installed
- Generate snapshot of your app (
dart --snapshot=file.snapshot file.dart
) - Run the source code generator (
dart bin/main.dart file.snapshot
) - Change to the
go_src
directory (cd go_src
) - Compile the Go package
(
env GOPATH=/full/path/to/go_src go build -v
) - Grab the
go_src/go_src
file – that's your executable – and rename it to your liking.
For other architectures (like Windows when you're running this on Mac, or vice versa), you'll need to:
- provide a matching executable
(
dart bin/main.dart --dart /full/path/to/dart.exe file.snapshot
) - run the Go compilation with the correct GOOS and GOARCH variables
(
env GOPATH=/full/path/to/go_src GOOS=windows GOARCH=386 go build -v
)