GrinderTask constructor

GrinderTask(String name, { Function taskFunction, String description, Iterable depends: const [] })

Create a new GrinderTask.

Items in depends represent task dependencies. They can either be String names of tasks (without arguments), or full TaskInvocations.

Implementation

GrinderTask(
  this.name, {
  this.taskFunction,
  this.description,
  Iterable<dynamic> depends: const [],
})
    : this.depends = new UnmodifiableListView(depends
          .map((dep) => dep is String ? new TaskInvocation(dep) : dep)) {
  if (taskFunction == null && depends.isEmpty) {
    throw new GrinderException(
        'GrinderTasks must have a task function or dependencies.');
  }
}