Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/drake/lib/tasks.ts>TaskRegistry

Drake is a make-like task runner for Deno.
Latest
class TaskRegistry
extends Map<string, Task>
import { TaskRegistry } from "https://deno.land/x/drake@v1.7.0/lib/tasks.ts";

Task registry map.

Constructors

new
TaskRegistry()

Properties

lastDesc: string

Methods

private
expand(names: string[]): Task[]

Recursively expand prerequisites and return a list of prerequisite tasks.

cacheFile(): string

Throw error if there are one or more task dependency cycles.

desc(description: string): void

Set description of next registered task.

execute(...names: string[])

Execute task action functions. First the non-async actions are executed synchronously then the async actions are executed asynchronously. Silently skip tasks that have no action function.

get(name: string): Task

Lookup task by task name. Throw error if task does not exist.

list(): string[]

Create a printable list of task names.

loadCache(filename: string): void
register(
name: string,
prereqs: string[],
action?: Action,
): void

Create and register a task.

resolveDependencies(names: string[]): Task[]

Return a list of tasks and all dependent tasks from the list of task names. Ordered in first to last execution order,

run(...names: string[])

Run tasks and prerequisite tasks in the correct dependency order.

saveCache(filename: string): void
set(name: string, task: Task)

Add task to registry. Throw error if task is already registered.