Package selection guidance compiled from public package information, community data, and project usage.
Grinder is a task runner for Dart that simplifies the automation of common project workflows such as testing, building, and code generation. It allows developers to define reusable tasks in Dart scripts, making it easy to standardize and streamline development processes across teams. With support for cross-platform execution on macOS, Windows, and Linux, Grinder integrates seamlessly into Dart and Flutter projects. Its clean syntax and extensible design make it ideal for managing complex build pipelines with minimal overhead.
Use cases
Automating build processes
Running tests and code checks
Managing release workflows
Generating boilerplate code
Simplifying CI/CD pipelines
Key features
Dart-based task definitions
Cross-platform compatibility
Extensible task system
Integrated with Flutter and Dart projects
Supports command-line execution
Suitable for
Dart and Flutter developers
Teams needing consistent workflows
CI/CD pipeline setup
Project maintainers
Considerations
Requires understanding of Dart scripting
Limited GUI interface
Best suited for command-line environments
May require additional configuration for complex workflows
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
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.
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:
dart run grinder:init
In general, grinder scripts look something like this:
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
You can also bypass installing grind and instead use pub run grinder.
Passing parameters to tasks
In order to pass parameters to tasks from the command-line, you query the
TaskArgs instance for your task invocation. For example:
grind build --release --mode=topaz
and:
@Task()
build() {
TaskArgs args = context.invocation.arguments;
bool isRelease = args.getFlag('release'); // will be set to trueString mode = args.getOption('mode'); // will be set to topaz
...
}
would pass the flag release and the option mode to the build task.
You can pass flags and options to multiple tasks. The following command-line
would pass separate flags and options to two different tasks: