Interface TaskModule

{@link http://gruntjs.com/api/grunt.task#queueing-tasks}

Hierarchy

Index

Properties

Methods

Properties

public current: IMultiTask

The currently running task or multitask.

see

http://gruntjs.com/api/inside-tasks

Methods

public clearQueue()

Empty the task queue completely. Unless additional tasks are enqueued, no more tasks will be run.

public normalizeMultiTaskFiles(data: IProjectConfig, targetname?: string): IFileMap[]

Normalizes a task target configuration object into an array of src-dest file mappings. This method is used internally by the multi task system this.files / grunt.task.current.files property.

Parameters

Returns

IFileMap[]

public registerMultiTask(taskName: string, taskFunction: Function)

Register a "multi task." A multi task is a task that implicitly iterates over all of its named sub-properties (AKA targets) if no target was specified. In addition to the default properties and methods, extra multi task-specific properties are available inside the task function as properties of the this object.

note

taskFunction.apply(scope: grunt.task.IMultiTask, args: any[])

Parameters

  • taskName: string
  • taskFunction: Function

public registerMultiTask(taskName: string, taskDescription: string, taskFunction: Function)

Parameters

  • taskName: string
  • taskDescription: string
  • taskFunction: Function

public registerTask(taskName: string, taskList: Array<string>)

If a task list is specified, the new task will be an alias for one or more other tasks. Whenever this "alias task" is run, every specified task in taskList will be run, in the order specified. The taskList argument must be an array of tasks.

Parameters

  • taskName: string
  • taskList: Array<string>

public registerTask(taskName: string, description: string, taskFunction: Function)

If a description and taskFunction are passed, the specified function will be executed whenever the task is run.

In addition, the specified description will be shown when grunt --help is run. Task-specific properties and methods are available inside the task function as properties of the this object. The task function can return false to indicate that the task has failed.

note

taskFunction.apply(scope: grunt.task.ITask, args: any[])

Parameters

  • taskName: string
  • description: string
  • taskFunction: Function

public run(tasks: Array<string>)

Enqueue one or more tasks. Every specified task in taskList will be run immediately after the current task completes, in the order specified. The task list can be an array of tasks or individual task arguments.

Parameters

  • tasks: Array<string>

public run(task: string, thenTasks?: Array<string>)

Parameters

  • task: string
  • thenTasks?: Array<string> optional