Ninja
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
Builder Struct Reference

Builder wraps the build process: starting commands, updating status. More...

#include <build.h>

List of all members.

Public Member Functions

NodeAddTarget (const string &name, string *err)
bool AddTarget (Node *target, string *err)
 Add a target to the build, scanning dependencies.
bool AlreadyUpToDate () const
 Returns true if the build targets are already up to date.
bool Build (string *err)
 Run the build.
 Builder (State *state, const BuildConfig &config, BuildLog *build_log, DepsLog *deps_log, DiskInterface *disk_interface)
void Cleanup ()
 Clean up after interrupted commands by deleting output files.
bool FinishCommand (CommandRunner::Result *result, string *err)
 Update status ninja logs following a command termination.
void SetBuildLog (BuildLog *log)
 Used for tests.
bool StartEdge (Edge *edge, string *err)
 ~Builder ()

Public Attributes

auto_ptr< CommandRunnercommand_runner_
const BuildConfigconfig_
Plan plan_
Statestate_
BuildStatusstatus_

Private Member Functions

 Builder (const Builder &other)
bool ExtractDeps (CommandRunner::Result *result, const string &deps_type, const string &deps_prefix, vector< Node * > *deps_nodes, string *err)
void operator= (const Builder &other)

Private Attributes

DiskInterfacedisk_interface_
DependencyScan scan_

Detailed Description

Builder wraps the build process: starting commands, updating status.

Definition at line 143 of file build.h.


Constructor & Destructor Documentation

Builder::Builder ( State state,
const BuildConfig config,
BuildLog build_log,
DepsLog deps_log,
DiskInterface disk_interface 
)

Definition at line 525 of file build.cc.

References status_.

Definition at line 533 of file build.cc.

References Cleanup().

Builder::Builder ( const Builder other) [private]

Member Function Documentation

Node * Builder::AddTarget ( const string &  name,
string *  err 
)

Definition at line 565 of file build.cc.

References State::LookupNode(), and state_.

Referenced by BuildTest::RebuildTarget(), and TEST_F().

bool Builder::AddTarget ( Node target,
string *  err 
)

Add a target to the build, scanning dependencies.

Returns:
false on error.

Definition at line 576 of file build.cc.

References Plan::AddTarget(), disk_interface_, Node::in_edge(), plan_, DependencyScan::RecomputeDirty(), scan_, and Node::StatIfNecessary().

bool Builder::AlreadyUpToDate ( ) const

Returns true if the build targets are already up to date.

Definition at line 591 of file build.cc.

References Plan::more_to_do(), and plan_.

Referenced by Build(), and BuildTest::RebuildTarget().

bool Builder::Build ( string *  err)
void Builder::Cleanup ( )

Clean up after interrupted commands by deleting output files.

Definition at line 537 of file build.cc.

References command_runner_, disk_interface_, DiskInterface::RemoveFile(), and DiskInterface::Stat().

Referenced by Build(), and ~Builder().

bool Builder::ExtractDeps ( CommandRunner::Result result,
const string &  deps_type,
const string &  deps_prefix,
vector< Node * > *  deps_nodes,
string *  err 
) [private]
bool Builder::FinishCommand ( CommandRunner::Result result,
string *  err 
)
void Builder::operator= ( const Builder other) [private]
void Builder::SetBuildLog ( BuildLog log) [inline]

Used for tests.

Definition at line 172 of file build.h.

References scan_, and DependencyScan::set_build_log().

Referenced by BuildWithLogTest::BuildWithLogTest().

bool Builder::StartEdge ( Edge edge,
string *  err 
)

Member Data Documentation

Definition at line 177 of file build.h.

Referenced by Build(), and FinishCommand().

Definition at line 187 of file build.h.

Referenced by AddTarget(), Cleanup(), ExtractDeps(), FinishCommand(), and StartEdge().

Definition at line 178 of file build.h.

Referenced by AddTarget(), AlreadyUpToDate(), Build(), and FinishCommand().

Definition at line 188 of file build.h.

Referenced by AddTarget(), FinishCommand(), and SetBuildLog().

Definition at line 176 of file build.h.

Referenced by AddTarget(), and ExtractDeps().

Definition at line 180 of file build.h.

Referenced by Build(), Builder(), FinishCommand(), and StartEdge().


The documentation for this struct was generated from the following files: