Skip to main content
Module

x/tdbuilder/Builder.ts>BuildRule

Simple build system written in Deno
Latest
interface BuildRule
import { type BuildRule } from "https://deno.land/x/tdbuilder@0.5.19/Builder.ts";

Properties

optional
description: string
optional
prereqs: Iterable<string> | AsyncIterable<string>

a list of names of targets that must be built before this build rule can be invoked

optional
invoke: BuildFunction

Function to invoke to build the target

optional
cmd: string[]

An alternative to invoke: a system command to be run

optional
buildFunctionTransformer: BuildFunctionTransformer

A function that will wrap the logic around running the build rule (said logic includes transforming cmd to a BuildFunction, built-in checks and logging).

May be used e.g. to lock a mutex before a rule is invoked and release it afterwards.

Defaults to the identity function.

optional
keepOnFailure: boolean

Unless set to true, the target will be removed if the build rule fails

optional
targetType: TargetTypeName

What does the target name name?

  • "auto" (default assumption) :: the target may be a file, a directory, or nothing. If a file or directory by the name does exist, its modification time will be used. Builder won't verify existence after invoking the build rule.
  • "directory" :: it is expected that a directory matching the name of the target will exist after the rule is invoked, and builder will automatically (by unspecified means) update the modification timestamp of the directory after the rule is invoked. If the target does not exist after invoking the build rule, or is not a directory (or symlink to one), an error will be thrown.
  • "file" :: the target name names a file to be created or updated, and if the file does not exist or is not a regular file (or symlink to one) after the rule is invoked, an error will be thrown.
  • "phony" :: the target is assumed to not correspond with anything on the filesystem, and will always be run.
optional
deprecated
isDirectory: boolean