Viewing version 0.7.0-dev.2. Open the latest package page.
grinder
0.7.0-dev.2Grinder - a task based, dependency aware build system.
Readme
Grinder for Dart
A task based, dependency aware build system.
Build Status Build status Coverage Status
Intro
Grinder is a library and tool to drive a command-line build.
Build files are entirely specified in Dart code. This allows you to write and debug your build files with the same tools you use for the rest of your project source.
Installing
To install, run:
pub global activate grinder
Getting Started
Your grinder build file should reside at tool/grind.dart. You can use grinder
to create a simple, starting build script. To do this, run:
pub global run grinder:init
This will create a starting script in tool/grind.dart.
In general, your build script will look something like this:
import 'package:grinder/grinder.dart';
main(args) => grind(args);
@Task('Initialize stuff.')
init() {
log("Initializing stuff...");
}
@Task('Compile stuff.')
@Depends(init)
compile() {
log("Compiling stuff...");
}
@DefaultTask('Deploy stuff.')
@Depends(compile)
deploy() {
log("Deploying stuff...");
}
Tasks to run are specified on the command line. If a task has dependencies, those dependent tasks are run before the specified task. Specifying no tasks on the command-line will run the default task if one is configured.
Command-line usage
usage: grind <options> target1 target2 ...
valid options:
-h, --help show targets but don't build
-d, --deps display the dependencies of targets
or:
pub global run grind <args>
will run the tool/grind.dart script with the supplied arguments.
API documentation
Documentation is available here.
Disclaimer
This is not an official Google product.
Changelog
grinder.dart changes
0.7.0
- Big changes! Task definititions are now primarily annotation based; see the readme for more information and an example
- The
GrinderContextarg is no longer expected in task functions. Instead, thecontextvariable (and thelogandfailfunctions) are available as global variables. They're injected into the zone running the current task. copyFileandcopyDirectoryand deprecated in favor of a newcopymethoddeleteEntityis deprecated in favor of a newdeletemethod- Renamed
runProcess/runProcessAsync/runDartScripttorun/runAsync/Dart.run. Process result info (stdout, stderr, exitCode) is now exposed by these methods and some others which call them. - Added a wrapper class around
pub global activateapplications -PubApp - Grinder can now create a simple starter script for a project - run
pub run grinder:init
0.6.5 (2015/1/13)
- added
defaultInit()anddefaultClean()methods, for common tasks - added methods for Pub.global.activate and Pub.global.run
- added an optional
workingDirectoryargument to more methods - added a
--versioncommand line flag - have the version command check to see if there's a newer version of grinder available
- the dart2js compile tasks now create the output directory if it doesn't exist
0.6.4 (2014/12/18)
- clarify that users should put their build scripts in
tools/grind.dart - add a
getSdkDirmethod
0.6.2 (2014/11/13)
- widen the version constraint on
quiver
0.6.1 (2014/10/12)
- widen the version constraint on
args
0.6.0 (2014/09/22)
The convenience API is now more terse:
- the
defineTask()method has been renamed totask() - instead of named parameters, the
task()function now uses optional positional parameters
Added two new entrypoint files in bin/: grind.dart and grinder.dart. These
let you run grinder via:
pub run grinder test
They look for a corresponding grinder script in the tool directory
(bin/grind.dart looks for tool/grind.dart and bin/grinder.dart looks for
tool/grinder.dart). If they find a corresponding script they run it in a new
Dart VM process. This means that projects will no longer have to have a
grind.sh script in the root of each project.
PubTool's build methods now take an optional workingDirectory argument.
Removed runSdkBinary and runSdkBinaryAsync, and they are no longer needed.
Use runProcess and runProcessAsync instead.
The methods on PubTools and Dart2jsTools are now static - you no longer need
to create an instance to use them. Also, PubTools was renamed to Pub and
Dart2jsTools was renamed to Dart2js. And a new utility class for
dartanalyzer - Analyzer - was created.
0.5.7 (2014/07/28)
- added
runProcessAsync()and related async methods (such asPubTools.buildAsync(...)) - removed duplicated stack traces when the build fails with exceptions
- throw an exception when running SDK binaries, and we are not able to locate the Dart SDK
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'grinder:0.7.0-dev.2'pubspec.yaml
name: grinder
# This version must be updated in tandem with the lib/src/cli.dart version.
version: 0.7.0-dev.2
description: Grinder - a task based, dependency aware build system.
homepage: https://github.com/google/grinder.dart
author: Devon Carew <devoncarew@google.com>
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
args: '>=0.10.0 <0.14.0'
cli_util: '>=0.0.1 <0.1.0'
glob: '>=1.0.0 <2.0.0'
http_server: '>=0.9.0 <0.10.0'
which: '>=0.1.2 <0.2.0'
dev_dependencies:
browser: any
unittest: any
executables:
grind:
grinder:
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.4 | Cached · Upstream SHA-256 matched | Download | 9de8fb40…df8a9a |
| 0.0.5 | Cached · Upstream SHA-256 matched | Download | 11a861da…414220 |
| 0.0.6 | Cached · Upstream SHA-256 matched | Download | 026d1bda…dc1cf7 |
| 0.0.7 | Cached · Upstream SHA-256 matched | Download | 9aeeb1a6…62e0c8 |
| 0.1.0 | Cached · Upstream SHA-256 matched | Download | 8dcdf8a3…41c1b0 |
| 0.4.0 | Cached · Upstream SHA-256 matched | Download | 0506fa5a…c1cac6 |
| 0.4.1 | Cached · Upstream SHA-256 matched | Download | dec74951…bbd082 |
| 0.4.2 | Cached · Upstream SHA-256 matched | Download | e0c8fde4…87f92b |
| 0.4.3 | Cached · Upstream SHA-256 matched | Download | 2bd14dd8…9d849d |
| 0.4.4 | Cached · Upstream SHA-256 matched | Download | 977e9974…8e8cfb |
| 0.4.5 | Cached · Upstream SHA-256 matched | Download | fec4fa7a…2702a1 |
| 0.5.0 | Cached · Upstream SHA-256 matched | Download | 4e9e52c6…c17619 |
| 0.5.1 | Cached · Upstream SHA-256 matched | Download | fde18f3e…b872ce |
| 0.5.2 | Cached · Upstream SHA-256 matched | Download | 86b75995…9a215a |
| 0.5.3 | Cached · Upstream SHA-256 matched | Download | 8063a366…934348 |
| 0.5.4 | Cached · Upstream SHA-256 matched | Download | 2a06c90a…bb06cc |
| 0.5.6 | Cached · Upstream SHA-256 matched | Download | 0409881b…3bf2e5 |
| 0.5.7 | Cached · Upstream SHA-256 matched | Download | 297ac833…1b9fe9 |
| 0.6.0 | Cached · Upstream SHA-256 matched | Download | 2f3b345b…01dc58 |
| 0.6.1 | Cached · Upstream SHA-256 matched | Download | 8e7d702d…9ed5fa |
| 0.6.2 | Cached · Upstream SHA-256 matched | Download | 56df3170…94ce90 |
| 0.6.3 | Cached · Upstream SHA-256 matched | Download | 10a4a0db…461924 |
| 0.6.4 | Cached · Upstream SHA-256 matched | Download | e1c3f8ee…293705 |
| 0.6.4+1 | Cached · Upstream SHA-256 matched | Download | 80d71af0…e4af3d |
| 0.6.5 | Cached · Upstream SHA-256 matched | Download | d45160a8…9faba7 |
| 0.6.6 | Cached · Upstream SHA-256 matched | Download | 94bcfcbe…d34385 |
| 0.6.6+1 | Cached · Upstream SHA-256 matched | Download | 1408c2e0…d5dfc8 |
| 0.6.6+2 | Cached · Upstream SHA-256 matched | Download | 40a33d3a…6a638e |
| 0.6.6+3 | Cached · Upstream SHA-256 matched | Download | 29081f9c…daf0bf |
| 0.7.0-dev.1 | Cached · Upstream SHA-256 matched | Download | 66e4961a…97767c |
| 0.7.0-dev.2 | Cached · Upstream SHA-256 matched | Download | d1ef1ac6…f588ac |
| 0.7.0 | Cached · Upstream SHA-256 matched | Download | 0ed2a625…8569f6 |
| 0.7.1 | Cached · Upstream SHA-256 matched | Download | 517a659e…147a66 |
| 0.7.1+1 | Cached · Upstream SHA-256 matched | Download | 2f2363a4…657a72 |
| 0.7.1+2 | Cached · Upstream SHA-256 matched | Download | 48203ae8…d619bb |
| 0.7.1+3 | Cached · Upstream SHA-256 matched | Download | 35450802…4ba96c |
| 0.7.2 | Cached · Upstream SHA-256 matched | Download | 4fa504d5…66229e |
| 0.8.0-dev.1 | Cached · Upstream SHA-256 matched | Download | 704fe8b8…5db868 |
| 0.8.0-dev.2 | Cached · Upstream SHA-256 matched | Download | 91bb8f19…9ad2fc |
| 0.8.0 | Cached · Upstream SHA-256 matched | Download | b12b054b…4a03e5 |
| 0.8.0+1 | Cached · Upstream SHA-256 matched | Download | 7714a971…00fbfc |
| 0.8.0+2 | Cached · Upstream SHA-256 matched | Download | 9b65c1fd…ee9c0f |
| 0.8.0+3 | Cached · Upstream SHA-256 matched | Download | 5dc15642…95cadf |
| 0.8.1 | Cached · Upstream SHA-256 matched | Download | 5b0b4425…e84f1d |
| 0.8.2 | Cached · Upstream SHA-256 matched | Download | 6636532c…bf91f7 |
| 0.8.3 | Cached · Upstream SHA-256 matched | Download | 8284e19b…b13f0d |
| 0.8.3+1 | Cached · Upstream SHA-256 matched | Download | 9653d450…29d19f |
| 0.8.4 | Cached · Upstream SHA-256 matched | Download | fdc35bbe…318f2a |
| 0.8.5 | Cached · Upstream SHA-256 matched | Download | 7fd2bed3…442c9b |
| 0.8.6 | Cached · Upstream SHA-256 matched | Download | 29e92765…cb37f1 |
| 0.9.0-nullsafety.0 | Cached · Upstream SHA-256 matched | Download | d6ddb4d1…8c8bfa |
| 0.9.0 | Cached · Upstream SHA-256 matched | Download | 2961d5bf…cf0fb9 |
| 0.9.1 | Cached · Upstream SHA-256 matched | Download | 2e8c0186…60fb19 |
| 0.9.2 | Cached · Upstream SHA-256 matched | Download | b24948a4…787b04 |
| 0.9.3 | Cached · Upstream SHA-256 matched | Download | 1dabcd70…7c8d00 |
| 0.9.4 | Cached · Upstream SHA-256 matched | Download | 48495acd…568b56 |
| 0.9.5 | Cached · Upstream SHA-256 matched | Download | e1996e48…1f6188 |
| 0.10.0 | Cached · Upstream SHA-256 matched | Download | 8c65fc6c…45093f |
| 0.10.1 | Cached · Upstream SHA-256 matched | Download | 7e0969c3…9dc8f3 |
| 0.10.2 | Cached · Upstream SHA-256 matched | Download | f8cf4d64…6d644a |
Dependencies
args "\u003e=0.10.0 \u003c0.14.0"
cli_util "\u003e=0.0.1 \u003c0.1.0"
glob "\u003e=1.0.0 \u003c2.0.0"
http_server "\u003e=0.9.0 \u003c0.10.0"
which "\u003e=0.1.2 \u003c0.2.0"