# grinder 0.7.0-dev.1

Grinder - a task based, dependency aware build system.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'grinder:0.7.0-dev.1'
```
Published: 2015-03-29T01:58:20.731920Z
Expected archive SHA-256: 66e4961ad1743c708f70c2c5a3f7fcf2e6bbf6e5337c9eb5fbbabbe3f297767c

Available in cache; verification: upstream_checksum
## Direct 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

## Package README (untrusted upstream documentation)
# Grinder for Dart

A task based, dependency aware build system.

[![Build Status](https://travis-ci.org/google/grinder.dart.svg?branch=master)](https://travis-ci.org/google/grinder.dart)
[![Build status](https://ci.appveyor.com/api/projects/status/rxskyfnov8evqwib/branch/master?svg=true)](https://ci.appveyor.com/project/devoncarew/grinder-dart/branch/master)
[![Coverage Status](https://img.shields.io/coveralls/google/grinder.dart.svg)](https://coveralls.io/r/google/grinder.dart)

## 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:

```dart
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](http://www.dartdocs.org/documentation/grinder/latest).

## 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](https://github.com/google/grinder.dart) for more information and an example
- The `GrinderContext` arg is no longer expected in task functions. Instead, the
  `context` variable (and the `log` and `fail` functions) are available as global
  variables. They're injected into the zone running the current task.
- `copyFile` and `copyDirectory` and deprecated in favor of a new `copy` method
- `deleteEntity` is deprecated in favor of a new `delete` method
- Added a wrapper class around `pub global activate` applications - `PubApplication`
- Grinder can now create a simple starter script for a project - run `pub global run grinder:init`

## 0.6.5 (2015/1/13)
- added `defaultInit()` and `defaultClean()` methods, for common tasks
- added methods for Pub.global.activate and Pub.global.run
- added an optional `workingDirectory` argument to more methods
- added a `--version` command 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 `getSdkDir` method

## 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 to `task()`
- 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 as
  `PubTools.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







 
