grinder 0.8.0+3

  • readme.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 72

Grinder

Dart workflows, automated.

Grinder consists of a library to define project tasks (e.g. test, build, doc), and a command-line tool to run them.

pub package Build Status Build status Coverage Status

Getting Started

To start using grinder, add it to your dev_dependencies.

Defining Tasks

Tasks are defined entirely by Dart code allowing you to take advantage of the whole Dart ecosystem to write and debug them. Task definitions reside in a tool/grind.dart script. To create a simple grinder script, run:

pub run grinder:init

In general, grinder scripts look something like this:

import 'package:grinder/grinder.dart';

main(args) => grind(args);

@DefaultTask('Build the project.')
build() {
  log("Building...");
}

@Task('Test stuff.')
@Depends(build)
test() {
  new PubApp.local('test').run([]);
}

@Task('Generate docs.')
doc() {
  log("Generating docs...");
}

@Task('Deploy built app.')
@Depends(build, test, doc)
deploy() {
  ...
}

Any task dependencies (see @Depends above), are run before the dependent task.

Grinder contains a variety of convenience APIs for common task definitions, such as PubApp referenced above. See the API Documentation for full details.

Running Tasks

First install the grind executable:

pub global activate grinder

then use it to run desired tasks:

grind test
grind build doc

or to run a default task (see @DefaultTask above):

grind

or to display a list of available tasks and their dependencies:

grind -h

or to tab-complete your tasks (thanks to unscripted):

grind --completion install
. ~/.bashrc

grind [TAB][TAB]
build  test   doc

grind b[TAB]
grind build

You can also bypass installing grind and instead use pub run grinder.

Disclaimer

This is not an official Google product.

grinder.dart changes

0.8.0+3

  • All APIs, including pub run grinder, always use the same Dart version as the user.

0.8.0+2

  • Added categories and extraArgs parameters to Dart2Js.compile() and Dart2Js.compileAsync()

0.8.0+1 (2015/11/12)

  • Fixed a bug with the DDC --html-report option

0.8.0 (2015/10/29)

  • Removed deprecated constants: BIN_DIR, BUILD_DIR, LIB_DIR, WEB_DIR
  • Removed the 120-col line wrapping on task output
  • Added a task for DDC (dev_compiler)
  • Fixed an issue where we were emitting overly verbose stack traces on failures
  • Fixed an issue where we would emit stdout after a failure, even when the stdout had been emitted as part of the task
  • Added outFile and enableExperimentalMirrors to the dart2js task
  • Some grinder output now written using ansi colors
  • Removed the deprecated defaultInit method.
  • Added a task for dartdoc
  • Added a new sdkBin() method

0.7.2 (2015/7/8)

  • Auto-expand directories passed to Analyzer.analyze() to a list of Dart source files using the added method findDartSourceFiles().
  • Add tests for Analyzer.analyze() task.
  • Add sourceDirs and existingSourceDirs to return the projects top-level directories usually containing Dart source files.
  • Deprecate the Tests class (in favor of TestRunner)
  • Add lineLength as an optional argument to DartFmt.format

0.7.1+3 (2015/5/24)

  • Fix bug with Dart.run/runAsync. Args were swapped.

0.7.1+2 (2015/5/24)

  • Add a Dart.runAsync static method.

0.7.1+1 (2015/5/19)

  • Add a files param to TestRunner.test.

0.7.1 (2015/5/19)

  • Added grind --completion install command to install tab-completion for task names and options in grind.
  • Improved grind -h (help) output.
  • Dart.run now takes an optional vmArgs, a list of arguments passed to the Dart VM.
  • Added downgrade method do Pub.
  • Introduce RunOptions to support all Process.run/Process.start parameters. The workingDirectory parameter is now deprecated in all methods, use RunOptions.workingDirectory instead.
  • Added PubApp.runAsync.
  • In Dart.run, deprecate the vmNewGenHeapMB and vmOldGenHeapMB options.
  • Added support for passing lists of files or directories to DartFmt.format().
  • Analyzer.analyzeFiles is deprecated in favor of Analyzer.analyze.
  • Added a Pub.global.list() method to list the installed applications.
  • added a TestRunner class - a wrapper around the new test package.

0.7.0 (2015/4/20)

  • Big changes! Task definitions are now primarily annotation based; see the readme 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.
  • pub [global] run grinder:grind no longer work, use pub [global] run grinder instead. Add :grinder if using pub run in Dart SDK < 1.10.
  • copyFile and copyDirectory and deprecated in favor of a new copy method
  • deleteEntity is deprecated in favor of a new delete method
  • Renamed runProcess/runProcessAsync/runDartScript to run/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 activate/run/pub run applications - 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() 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

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  grinder: "^0.8.0+3"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:grinder/grinder.dart';
        
Version Uploaded Documentation Archive
0.8.0+3 Oct 16, 2016 Go to the documentation of grinder 0.8.0+3 Download grinder 0.8.0+3 archive
0.8.0+2 Jan 27, 2016 Go to the documentation of grinder 0.8.0+2 Download grinder 0.8.0+2 archive
0.8.0+1 Nov 13, 2015 Go to the documentation of grinder 0.8.0+1 Download grinder 0.8.0+1 archive
0.8.0 Oct 29, 2015 Go to the documentation of grinder 0.8.0 Download grinder 0.8.0 archive
0.7.2 Jul 9, 2015 Go to the documentation of grinder 0.7.2 Download grinder 0.7.2 archive
0.7.1+3 May 24, 2015 Go to the documentation of grinder 0.7.1+3 Download grinder 0.7.1+3 archive
0.7.1+2 May 24, 2015 Go to the documentation of grinder 0.7.1+2 Download grinder 0.7.1+2 archive
0.7.1+1 May 20, 2015 Go to the documentation of grinder 0.7.1+1 Download grinder 0.7.1+1 archive
0.7.1 May 19, 2015 Go to the documentation of grinder 0.7.1 Download grinder 0.7.1 archive
0.7.0 Apr 21, 2015 Go to the documentation of grinder 0.7.0 Download grinder 0.7.0 archive

All 43 versions...

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
86
Health:
Code health derived from static analysis. [more]
67
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
43
Overall score:
Weighted score of the above. [more]
72

Platforms

Detected platforms:

Error(s) prevent platform classification.

Suggestions

  • Fix lib/src/utils.dart.

    Strong-mode analysis of lib/src/utils.dart failed with the following error:

    line: 21 col: 36
    The function expression type '(List<dynamic>, List<dynamic>) → void' isn't of type '(List<dynamic>, List<dynamic>) → List<dynamic>'. This means its parameter or return type does not match what is expected. Consider changing parameter type(s) or the returned type(s).

  • Fix lib/src/grinder_task.dart.

    Strong-mode analysis of lib/src/grinder_task.dart failed with the following error:

    line: 54 col: 49
    The argument type 'List' can't be assigned to the parameter type 'Iterable<TaskInvocation>'.

  • Fix further 1 Dart files.

    Similar analysis of the following files failed:

    • lib/src/cli_util.dart
  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

  • Enable strong mode analysis.

    Strong mode helps you to detect bugs and potential issues earlier.Start your analysis_options.yaml file with the following:

    analyzer:
      strong-mode: true
    

Dependencies

Package Constraint Resolved Available
Direct dependencies
ansicolor >=0.0.9 <0.1.0 0.0.9
collection >=1.1.0 <2.0.0 1.14.3
glob >=1.0.0 <2.0.0 1.1.5
path >=1.0.0 <2.0.0 1.5.1
unscripted >=0.6.1+1 <0.7.0 0.6.2
Transitive dependencies
args 0.13.7 1.2.0
async 2.0.1
charcode 1.1.1
logging 0.11.3+1
mockable_filesystem 0.0.3
source_span 1.4.0
string_scanner 1.0.2
supports_color 0.1.1
Dev dependencies
test ^0.12.0