The basic building blocks for a build.
Code Map
//! The basic building blocks for a build.
module build.core.target;
//! Holds all inspected files/targets for a build. The caching supplied by
//! this class helps with both speed and ease of use.
class Instance
{
public:
this() { }
fn file(name: string) Target { }
fn fileNoRule(name: string) Target { }
}
//! Most basic building block, represent a single file on the file system.
//! Can be used as a dependency and as a target to be built.
class Target
{
public:
enum Status
{
FRESH,
CHECKED,
BLOCKED,
BUILDING,
BUILT,
}
public:
alias FRESH = Status.FRESH;
alias CHECKED = Status.CHECKED;
alias BLOCKED = Status.BLOCKED;
alias BUILDING = Status.BUILDING;
alias BUILT = Status.BUILT;
public:
//! What is the status of this target.Used to skip updating the date.
status: Status;
//! Name, for file also actuall filename.
name: string;
//! Rule to build this targe.
rule: Rule;
//! Will be built, but if no rule and missing will be ignored.
deps: Target[];
//! Cached last modified time.
mod: u64;
public:
this() { }
//! Updates the @mod field to the files last modified time.
fn updateTime() { }
fn built() { }
}
//! Rule to be executed. Can be shared for multiple targets.
class Rule
{
public:
//! To run be executed.
cmd: string;
//! To be given to cmd.
args: string[];
//! Echoed to stdout.
print: string;
//! Files needed directly to run this rule.
input: Target[];
//! When the rule is running these targets will be locked.
outputs: Target[];
public:
this() { }
fn built(retval: i32) { }
}
Holds all inspected files/targets for a build. The caching supplied by this class helps with both speed and ease of use.
Most basic building block, represent a single file on the file system. Can be used as a dependency and as a target to be built.
What is the status of this target.Used to skip updating the date.
Name, for file also actuall filename.
Rule to build this targe.
Will be built, but if no rule and missing will be ignored.
Cached last modified time.
Updates the @mod field to the files last modified time.
Rule to be executed. Can be shared for multiple targets.
To run be executed.
To be given to cmd.
Echoed to stdout.
Files needed directly to run this rule.
When the rule is running these targets will be locked.