GrinderTask constructor

GrinderTask(
  1. String name, {
  2. Function? taskFunction,
  3. String? description,
  4. 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 [],
}) : depends = UnmodifiableListView(
          depends.map((dep) => dep is String ? TaskInvocation(dep) : dep)) {
  if (taskFunction == null && depends.isEmpty) {
    throw GrinderException(
        'GrinderTasks must have a task function or dependencies.');
  }
}