|
Ninja
|
Builder wraps the build process: starting commands, updating status. More...
#include <build.h>
Public Member Functions | |
| Node * | AddTarget (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) | |
| void | FinishEdge (Edge *edge, bool success, const string &output) |
| bool | StartEdge (Edge *edge, string *err) |
Public Attributes | |
| CommandRunner * | command_runner_ |
| const BuildConfig & | config_ |
| DiskInterface * | disk_interface_ |
| struct BuildLog * | log_ |
| Plan | plan_ |
| State * | state_ |
| struct BuildStatus * | status_ |
Builder wraps the build process: starting commands, updating status.
| Builder::Builder | ( | State * | state, |
| const BuildConfig & | config | ||
| ) |
Definition at line 434 of file build.cc.
References State::build_log_, command_runner_, disk_interface_, BuildConfig::dry_run, log_, and status_.
| Node * Builder::AddTarget | ( | const string & | name, |
| string * | err | ||
| ) |
Definition at line 445 of file build.cc.
References State::LookupNode(), and state_.
Referenced by main().
| bool Builder::AddTarget | ( | Node * | target, |
| string * | err | ||
| ) |
Add a target to the build, scanning dependencies.
Definition at line 456 of file build.cc.
References Plan::AddTarget(), disk_interface_, Node::file_, Node::in_edge_, plan_, state_, and FileStat::StatIfNecessary().
| bool Builder::AlreadyUpToDate | ( | ) | const |
| bool Builder::Build | ( | string * | err | ) |
Run the build.
Returns false on error. It is an error to call this function when AlreadyUpToDate() is true.
Definition at line 475 of file build.cc.
References AlreadyUpToDate(), CommandRunner::CanRunMore(), Plan::command_edge_count(), command_runner_, config_, Plan::FindWork(), FinishEdge(), Plan::more_to_do(), plan_, BuildStatus::PlanHasTotalEdges(), StartEdge(), status_, BuildConfig::swallow_failures, and CommandRunner::WaitForCommand().
Referenced by main().
| void Builder::FinishEdge | ( | Edge * | edge, |
| bool | success, | ||
| const string & | output | ||
| ) |
Definition at line 572 of file build.cc.
References BuildStatus::BuildEdgeFinished(), Plan::CleanNode(), Plan::command_edge_count(), disk_interface_, Plan::EdgeFinished(), Edge::inputs_, Edge::is_phony(), log_, Edge::order_only_deps_, Edge::outputs_, plan_, BuildStatus::PlanHasTotalEdges(), BuildLog::RecordCommand(), Rule::restat_, Edge::rule_, DiskInterface::Stat(), and status_.
Referenced by Build().
| bool Builder::StartEdge | ( | Edge * | edge, |
| string * | err | ||
| ) |
Definition at line 548 of file build.cc.
References BuildStatus::BuildEdgeStarted(), command_runner_, disk_interface_, Edge::EvaluateCommand(), Edge::is_phony(), DiskInterface::MakeDirs(), Edge::outputs_, CommandRunner::StartCommand(), and status_.
Referenced by Build().
Definition at line 133 of file build.h.
Referenced by Build(), Builder(), BuildTest::BuildTest(), and StartEdge().
| const BuildConfig& Builder::config_ |
Definition at line 132 of file build.h.
Referenced by AddTarget(), Builder(), BuildTest::BuildTest(), FinishEdge(), and StartEdge().
| struct BuildLog* Builder::log_ |
Definition at line 135 of file build.h.
Referenced by Builder(), BuildWithLogTest::BuildWithLogTest(), and FinishEdge().
Definition at line 131 of file build.h.
Referenced by AddTarget(), AlreadyUpToDate(), Build(), and FinishEdge().
Definition at line 129 of file build.h.
Referenced by AddTarget().
| struct BuildStatus* Builder::status_ |
Definition at line 134 of file build.h.
Referenced by Build(), Builder(), FinishEdge(), and StartEdge().
1.7.5.1