|
Ninja
|
#include <clean.h>
Public Member Functions | |
| int | CleanAll (bool generator=false) |
| Clean all built files, except for files created by generator rules. More... | |
| int | CleanDead (const BuildLog::Entries &entries) |
| Clean the files produced by previous builds that are no longer in the manifest. More... | |
| int | cleaned_files_count () const |
| Cleaner (State *state, const BuildConfig &config, DiskInterface *disk_interface) | |
| Build a cleaner object with the given disk_interface. More... | |
| int | CleanRule (const char *rule) |
| Clean the file produced by the given rule. More... | |
| int | CleanRule (const Rule *rule) |
| Clean all the file built with the given rule rule. More... | |
| int | CleanRules (int rule_count, char *rules[]) |
| Clean the file produced by the given rules. More... | |
| int | CleanTarget (const char *target) |
| Clean the given target target. More... | |
| int | CleanTarget (Node *target) |
| Clean the given target and all the file built for it. More... | |
| int | CleanTargets (int target_count, char *targets[]) |
| Clean the given target targets. More... | |
| bool | IsVerbose () const |
Private Member Functions | |
| void | DoCleanRule (const Rule *rule) |
| void | DoCleanTarget (Node *target) |
| Helper recursive method for CleanTarget(). More... | |
| bool | FileExists (const std::string &path) |
| bool | IsAlreadyRemoved (const std::string &path) |
| void | LoadDyndeps () |
| Load dependencies from dyndep bindings. More... | |
| void | PrintFooter () |
| void | PrintHeader () |
| void | Remove (const std::string &path) |
| Remove the given path file only if it has not been already removed. More... | |
| void | RemoveEdgeFiles (Edge *edge) |
| Remove the depfile and rspfile for an Edge. More... | |
| int | RemoveFile (const std::string &path) |
| Remove the file path. More... | |
| void | Report (const std::string &path) |
| void | Reset () |
Private Attributes | |
| std::set< Node * > | cleaned_ |
| int | cleaned_files_count_ |
| const BuildConfig & | config_ |
| DiskInterface * | disk_interface_ |
| DyndepLoader | dyndep_loader_ |
| std::set< std::string > | removed_ |
| State * | state_ |
| int | status_ |
| Cleaner::Cleaner | ( | State * | state, |
| const BuildConfig & | config, | ||
| DiskInterface * | disk_interface | ||
| ) |
| int Cleaner::CleanAll | ( | bool | generator = false | ) |
Clean all built files, except for files created by generator rules.
| generator | If set, also clean files created by generator rules. |
Definition at line 104 of file clean.cc.
References State::edges_, LoadDyndeps(), PrintFooter(), PrintHeader(), Remove(), RemoveEdgeFiles(), Reset(), state_, and status_.
| int Cleaner::CleanDead | ( | const BuildLog::Entries & | entries | ) |
Clean the files produced by previous builds that are no longer in the manifest.
Definition at line 127 of file clean.cc.
References Node::in_edge(), LoadDyndeps(), State::LookupNode(), Node::out_edges(), PrintFooter(), PrintHeader(), Remove(), Reset(), state_, and status_.
|
inline |
Definition at line 66 of file clean.h.
References cleaned_files_count_.
| int Cleaner::CleanRule | ( | const char * | rule | ) |
Clean the file produced by the given rule.
Definition at line 249 of file clean.cc.
References State::bindings_, CleanRule(), Error(), BindingEnv::LookupRule(), Reset(), state_, and status_.
| int Cleaner::CleanRule | ( | const Rule * | rule | ) |
Clean all the file built with the given rule rule.
Definition at line 238 of file clean.cc.
References DoCleanRule(), LoadDyndeps(), PrintFooter(), PrintHeader(), Reset(), and status_.
Referenced by CleanRule().
| int Cleaner::CleanRules | ( | int | rule_count, |
| char * | rules[] | ||
| ) |
Clean the file produced by the given rules.
Definition at line 263 of file clean.cc.
References State::bindings_, DoCleanRule(), Error(), IsVerbose(), LoadDyndeps(), BindingEnv::LookupRule(), PrintFooter(), PrintHeader(), Reset(), state_, and status_.
| int Cleaner::CleanTarget | ( | const char * | target | ) |
Clean the given target target.
Definition at line 182 of file clean.cc.
References CleanTarget(), Error(), State::LookupNode(), Reset(), state_, and status_.
| int Cleaner::CleanTarget | ( | Node * | target | ) |
Clean the given target and all the file built for it.
Definition at line 171 of file clean.cc.
References DoCleanTarget(), LoadDyndeps(), PrintFooter(), PrintHeader(), Reset(), and status_.
Referenced by CleanTarget().
| int Cleaner::CleanTargets | ( | int | target_count, |
| char * | targets[] | ||
| ) |
Clean the given target targets.
Definition at line 196 of file clean.cc.
References CanonicalizePath(), DoCleanTarget(), Error(), IsVerbose(), LoadDyndeps(), State::LookupNode(), PrintFooter(), PrintHeader(), Reset(), state_, and status_.
|
private |
Definition at line 223 of file clean.cc.
References State::edges_, Rule::name(), Remove(), RemoveEdgeFiles(), and state_.
Referenced by CleanRule(), and CleanRules().
|
private |
Helper recursive method for CleanTarget().
Definition at line 150 of file clean.cc.
References cleaned_, Node::in_edge(), Node::path(), Remove(), and RemoveEdgeFiles().
Referenced by CleanTarget(), and CleanTargets().
|
private |
Definition at line 42 of file clean.cc.
References disk_interface_, Error(), and DiskInterface::Stat().
Referenced by Remove().
|
private |
|
inline |
Definition at line 71 of file clean.h.
References config_, BuildConfig::dry_run, BuildConfig::QUIET, BuildConfig::VERBOSE, and BuildConfig::verbosity.
Referenced by CleanRules(), CleanTargets(), PrintHeader(), and Report().
|
private |
Load dependencies from dyndep bindings.
Definition at line 292 of file clean.cc.
References dyndep_loader_, Node::dyndep_pending(), State::edges_, DyndepLoader::LoadDyndeps(), and state_.
Referenced by CleanAll(), CleanDead(), CleanRule(), CleanRules(), CleanTarget(), and CleanTargets().
|
private |
Definition at line 98 of file clean.cc.
References cleaned_files_count_, config_, BuildConfig::QUIET, and BuildConfig::verbosity.
Referenced by CleanAll(), CleanDead(), CleanRule(), CleanRules(), CleanTarget(), and CleanTargets().
|
private |
Definition at line 87 of file clean.cc.
References config_, IsVerbose(), BuildConfig::QUIET, and BuildConfig::verbosity.
Referenced by CleanAll(), CleanDead(), CleanRule(), CleanRules(), CleanTarget(), and CleanTargets().
|
private |
Remove the given path file only if it has not been already removed.
Definition at line 56 of file clean.cc.
References config_, BuildConfig::dry_run, FileExists(), IsAlreadyRemoved(), removed_, RemoveFile(), Report(), and status_.
Referenced by CleanAll(), CleanDead(), DoCleanRule(), DoCleanTarget(), and RemoveEdgeFiles().
|
private |
Remove the depfile and rspfile for an Edge.
Definition at line 77 of file clean.cc.
References Edge::GetUnescapedDepfile(), Edge::GetUnescapedRspfile(), and Remove().
Referenced by CleanAll(), DoCleanRule(), and DoCleanTarget().
|
private |
Remove the file path.
Definition at line 38 of file clean.cc.
References disk_interface_, and DiskInterface::RemoveFile().
Referenced by Remove().
|
private |
Definition at line 50 of file clean.cc.
References cleaned_files_count_, and IsVerbose().
Referenced by Remove().
|
private |
Definition at line 285 of file clean.cc.
References cleaned_, cleaned_files_count_, removed_, and status_.
Referenced by CleanAll(), CleanDead(), CleanRule(), CleanRules(), CleanTarget(), and CleanTargets().
|
private |
Definition at line 105 of file clean.h.
Referenced by DoCleanTarget(), and Reset().
|
private |
Definition at line 106 of file clean.h.
Referenced by cleaned_files_count(), PrintFooter(), Report(), and Reset().
|
private |
Definition at line 102 of file clean.h.
Referenced by IsVerbose(), PrintFooter(), PrintHeader(), and Remove().
|
private |
Definition at line 107 of file clean.h.
Referenced by FileExists(), and RemoveFile().
|
private |
Definition at line 103 of file clean.h.
Referenced by LoadDyndeps().
|
private |
Definition at line 104 of file clean.h.
Referenced by IsAlreadyRemoved(), Remove(), and Reset().
|
private |
Definition at line 101 of file clean.h.
Referenced by CleanAll(), CleanDead(), CleanRule(), CleanRules(), CleanTarget(), CleanTargets(), DoCleanRule(), and LoadDyndeps().
|
private |
Definition at line 108 of file clean.h.
Referenced by CleanAll(), CleanDead(), CleanRule(), CleanRules(), CleanTarget(), CleanTargets(), Remove(), and Reset().