Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ningen/mod.ts>Ningen

Simple ninja build generator
Latest
class Ningen
import { Ningen } from "https://deno.land/x/ningen@0.0.6/mod.ts";

Constructors

new
Ningen(directory: string)

Methods

build(unnamed 0: { rule: Rule; inputs: Files; outputs: Files; vars?: Vars; pool?: Pool | ""; isDefault?: boolean; }): Target
file(filename: string): File

Constructs a File object from the given filename. If {@code filename} is a relative path, uses {@code directory} as the root directory.

files(...filenames: (string | string[])[]): Files

Constructs a list of File objects from the given filenames. You can supply either an array of filenames, or a vararg list of filenames.

generate(unnamed 0?: { inputs?: Files; output?: File; enableGeneratorRule?: boolean; generatorRule?: Rule; })

Generates the build.ninja file. Filename can be overridden.

generateToString(unnamed 0: { inputs?: Files; output?: File; enableGeneratorRule?: boolean; generatorRule?: Rule; }): string

Returns contents of generated ninja file. Use only for testing.

glob(globs: string | string[], unnamed 1?: { exclude?: string[]; canBeEmpty?: boolean; }): Files

Returns all files matching the given glob(s). Optionally can supply other globs to exclude certain paths.

Supply either a single string, e.g. glob("*.jpg"), or an array of strings, e.g. glob(["*.jpg", "*.png"]).

pool(unnamed 0: { name: string; depth: number; }): Pool

Clears all defined rules and targets. Use only for testing.

rule(unnamed 0: { name: string; command: string; binary?: File; srcs?: Files; description?: string; vars?: Vars; generator?: boolean; pool?: Pool | "console"; }): Rule