-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Declare tasks programatically rather than declaratively
This has a few benefits: * It allows us to dynamically choose task dependencies (so for example the Linux standalone package can depend on the native executable task when running on Linux). * Similar tasks can be defined programmatically. * Task names are decoupled from Dart function names, which in turn allows us to avoid manually namespacing the package in favor of encouraging it to be imported with a Dart namespace. * It works around google/grinder.dart#337 and google/grinder.dart#338.
- Loading branch information
Showing
13 changed files
with
726 additions
and
760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
These tasks upload [standalone packages][] to GitHub releases. They're enabled | ||
by calling [`pkg.addGithubTasks()`][], which automatically calls | ||
[`pkg.addStandaloneTasks()`][] | ||
|
||
[standalone packages]: standalone.md | ||
[`pkg.addGithubTasks()`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/addGithubTasks.html | ||
[`pkg.addStandaloneTasks()`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/addStandaloneTasks.html | ||
|
||
## `pkg-github-release` | ||
|
||
Uses configuration: [`pkg.humanName`][], [`pkg.version`][], | ||
[`pkg.githubRepo`][], [`pkg.githubReleaseNotes`][] | ||
|
||
[`pkg.humanName`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/humanName.html | ||
[`pkg.version`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/version.html | ||
[`pkg.githubRepo`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/githubRepo.html | ||
[`pkg.githubReleaseNotes`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/githubReleaseNotes.html | ||
|
||
Creates a GitHub release for the current version of this package, without any | ||
files uploaded to it. | ||
|
||
## `pkg-github-$os` | ||
|
||
Depends on: [`pkg-standalone-$os-ia32`, `pkg-standalone-$os-x64`][] | ||
|
||
[`pkg-standalone-$os-ia32`, `pkg-standalone-$os-x64`]: standalone.md#pkg-standalone-os-arch | ||
|
||
Uses configuration: [`pkg.version`][], [`pkg.githubRepo`][], [`pkg.standaloneName`][] | ||
|
||
[`pkg.standaloneName`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/standaloneName.html | ||
|
||
Uploads 32- and 64-bit executable packages for the given operating system | ||
(`linux`, `windows`, or `macos`) to the GitHub release for the current version. | ||
|
||
Any OS's packages can be built and uploaded regardless of the OS running the | ||
task, but if the host OS matches the target OS the 64-bit executable will be | ||
built as a native executable, which is substantially faster. | ||
|
||
This must be invoked after [`pkg-github-release`][], but it doesn't have a | ||
built-in dependency so that different OSs' packages can be built in different | ||
build steps. | ||
|
||
[`pkg-github-release`]: #pkg-github-release | ||
|
||
## `pkg-github-all` | ||
|
||
Depends on: [`pkg-github-release`][], [`pkg-github-linux`, `pkg-github-macos`, | ||
`pkg-github-windows`][]. | ||
|
||
[`pkg-github-linux`, `pkg-github-macos`, `pkg-github-windows`]: #pkg-github-os | ||
|
||
A utility task for creating a release and uploading packages for all operating | ||
systems in the same step. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
These tasks create self-contained archives containing the Dart VM and snapshots | ||
of the package's executables, which can then be easily distributed. They're the | ||
basis for many other tasks that upload the packages to various package managers. | ||
They're enabled by calling [`pkg.addStandaloneTasks()`][]. | ||
|
||
[`pkg.addStandaloneTasks()`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/addStandaloneTasks.html | ||
|
||
## `pkg-compile-snapshot` | ||
|
||
Uses configuration: [`pkg.entrypoints`][] | ||
|
||
[`pkg.entrypoints`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/entrypoints.html | ||
|
||
Output: `build/$entrypoint.snapshot` | ||
|
||
Compiles each executable in the package to a [kernel snapshot][snapshot]. | ||
|
||
[snapshots]: https://github.com/dart-lang/sdk/wiki/Snapshots | ||
|
||
## `pkg-compile-native` | ||
|
||
Uses configuration: [`pkg.entrypoints`][], [`pkg.version`][] | ||
|
||
[`pkg.version`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/version.html | ||
|
||
Output: `build/$entrypoint.native` | ||
|
||
Compiles each executable in the package to a native code snapshot (what Dart | ||
calls an ["AOT Application snapshot"][snapshot]). This is unavailable on 32-bit | ||
host systems. | ||
|
||
Defines an environment constant named `version` set to [`pkg.version`][] that | ||
can be accessed from within each entrypoint via [`String.fromEnvironment()`][]. | ||
|
||
[`String.fromEnvironment()`]: https://api.dartlang.org/stable/dart-core/String/String.fromEnvironment.html | ||
|
||
## `pkg-standalone-$os-$arch` | ||
|
||
Depends on: [`pkg-compile-snapshot`][] or [`pkg-compile-native`][] | ||
|
||
[`pkg-compile-snapshot`]: #pkg-compile-snapshot | ||
[`pkg-compile-native`]: #pkg-compile-native | ||
|
||
Uses configuration: [`pkg.version`][], [`pkg.standaloneName`][], [`pkg.entrypoints`][] | ||
|
||
[`pkg.standaloneName`]: https://pub.dev/documentation/dart_cli_pkg/latest/cli_pkg/standaloneName.html | ||
|
||
Output: `build/$standaloneName-$version-$os-$arch.(tar.gz|zip)` | ||
|
||
Creates an archive that contains all this package's entrypoints along with the | ||
Dart VM for the given operating system and architecture, with top-level scripts | ||
that can be used to invoke them. | ||
|
||
Any OS's packages can be built regardless of the OS running the task, but if the | ||
host OS matches the target OS *and* the architecture is 64-bit, executables will | ||
be built as native (["AOT"][snapshot]) executables, which are substantially | ||
faster and smaller than the kernel snapshots that are generated otherwise. | ||
|
||
This produces a ZIP file in Windows, and a gzipped TAR file on Linux and Mac OS. | ||
|
||
## `pkg-standalone-all` | ||
|
||
Depends on: [`pkg-standalone-linux-ia32`, `pkg-standalone-linux-x64`, | ||
`pkg-standalone-macos-ia32`, `pkg-standalone-macos-x64`, | ||
`pkg-standalone-windows-ia32`, `pkg-standalone-windows-x64`][] | ||
|
||
[`pkg-standalone-linux-ia32`, `pkg-standalone-linux-x64`, `pkg-standalone-macos-ia32`, `pkg-standalone-macos-x64`, `pkg-standalone-windows-ia32`, `pkg-standalone-windows-x64`]: #pkg-standalone-os-arch | ||
|
||
A utility task for creating a packages for all operating systems in the same | ||
step. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.