SequentialTasks class

A task that runs a series of sub-tasks sequentially on a set of files.

The SequentialTasks class extends SequentialTask and is used to execute a list of sub-tasks one after the other. Each sub-task is executed only if the previous sub-task completes successfully (i.e., returns a zero exit code).

Example usage:

SequentialTasks(
  tasks: [
    ShellTask(
      include: [Glob('**.dart')],
      commands: (filePaths) => [
        'dart format ${filePaths.join(' ')}',
      ],
    ),
    ShellTask(
      include: [Glob('**.dart')],
      commands: (filePaths) => [
        'sip test --concurrent --bail',
      ],
    ),
  ],
);

The above example creates a SequentialTasks instance that runs two ShellTask instances sequentially. The first task formats Dart files, and the second task runs tests on the Dart files.

Inheritance

Constructors

SequentialTasks({required List<HookTask> tasks, String? name, List<Pattern> exclude = const []})

Properties

exclude → List<Pattern>
The list of patterns to exclude files.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
id → String
The unique identifier for the task.
finalinherited
include → List<Pattern>
The list of patterns to include files.
finalinherited
name → String?
The name of the task.
final
patternName → String
Gets the pattern name for the task.
no setterinherited
resolvedName → String
Gets the resolved name for the task.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shouldAlwaysRun → bool
no setterinherited
workingDirectory → String?
finalinherited

Methods

filterFiles(Iterable<String> filePaths) → List<String>
Filters the given file paths based on the include and exclude patterns.
inherited
label(Iterable<String> filePaths) → TaskLabel
Creates a label for the task with the given file paths.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(List<String> filePaths, int index) → ResolvedHookTask
Resolves the task with the given file paths and index.
inherited
resolveSubTasks(Iterable<String> filePaths) → List<HookTask>
Resolves the list of sub-tasks for the given file paths.
inherited
run(List<String> filePaths, {required void print(String?), required void completeTask(HookTask, int), required void startTask(HookTask), required String? workingDirectory}) → FutureOr<int>
Runs the task with the given file paths.
inherited
subTasks(Iterable<String> filePaths) → List<HookTask>
Gets the list of sub-tasks for the given file paths.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited