summaryrefslogtreecommitdiffstats
path: root/src/clean.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add 'using namespace std;' to all cc files to prepare for removing it from ↵Michael Jones2020-09-301-0/+2
| | | | header files
* [clang-tidy] remove redundant member initRosen Penev2020-06-181-2/+0
| | | | | | Found with readability-redundant-member-init Signed-off-by: Rosen Penev <rosenp@gmail.com>
* Adding a way to clean dead build artifacts that have an entry in the build log,ikifof2019-05-251-0/+13
| | | | | | | | | | | | but are no longer produced by the current manifest. For now adding a dedicated "-t cleandead" option, since it should be run after reading the log; ideally it should be part of the build config and done before to start looking for dirty targets so that an incremental build would produce the same end result as a clean build from scratch. But since I am not 100% sure to understand the comment in the NinjaMain::isPathDead(), I opted to make it a tool for now to avoid impacting users who want to keep those files. The option name "cleandead" was selected insteadof something like "reap" to keep the "clean" prefix.
* clean: remove outputs specified by dyndep filesBrad King2019-04-181-0/+19
| | | | | | Some outputs may not be known in the main build manifest and are instead discovered through a dyndep binding. Load dyndep files that are available during cleaning so that we can clean these outputs too.
* clean: remove unnecessary Cleaner constructor variantBrad King2019-04-181-10/+0
| | | | | | | | `Cleaner` provides two constructors that are the same except that one constructs a "real" disk interface internally and the other takes a caller-provided disk interface. A real disk interface is already available at the only call site for the former constructor. Use it directly and drop the unnecessary constructor variant.
* Merge pull request #1299 from pcc/fflushJan Niklas Hasse2018-10-301-0/+1
|\ | | | | Flush stdout after printing "Cleaning..." message
| * Flush stdout after printing "Cleaning..." messagePeter Collingbourne2017-07-051-0/+1
| |
* | Canonicalize targets of clean command.Frank Henigman2018-04-051-8/+15
|/ | | | | | This corrects an inconsistency where build targets were canonicalized but clean targets were not. For example you could build ./foo but not clean ./foo.
* Let Stat() have an err outparam instead of writing to stderr.Nico Weber2015-03-311-1/+5
| | | | | | | | | Also check for Stat() failure in a few more places. This way, ninja doesn't print two "ninja: error: " lines if stat() fails during a build. It also makes it easier to keep the stat tests quiet. Every caller of Stat() needs to explicitly log the error string if that's desired.
* Allow scoping rules through subninjaMohamed Bamakhrama2015-03-011-2/+2
| | | | | | | | Ninja didn't support scoping rules through subninja and assumed a unique rule name in the whole namespace. With this change, this behavior is changed to allow scoping rules. Two rules can have the same name if they belong to two different scopes. However, two rules can NOT have the same name in the same scope.
* Make "depfile=$out.d" work if $out contains escaped characters, rspfile too.Nico Weber2014-05-211-2/+2
| | | | | | | | | | | | | | Fixes #730. This has always been broken, but due to #690 more paths are now escaped (e.g. paths containing + characters, like file.c++). Also see discussion in #689. The approach is to give EdgeEnv an enum deciding on whether or not to escape file names, and provide functions that evaluate depfile and rspfile with that set that to kNoEscape. (depfile=$out.d doesn't make sense on edges with multiple outputs.) This should be relatively safe, as $in and $out can't be used on edges, only on rules (#687).
* Remove a few unused includes.Nico Weber2013-05-121-3/+0
|
* rearrange handling of builtin bindings to make rules simplerEvan Martin2012-12-291-3/+3
| | | | | Now, a 'build' block can override any special binding like 'command' or 'description' if it needs to.
* refactor repeated code in cleanerEvan Martin2012-10-311-14/+14
|
* Improve the efficiency of -t cleanPetr Wolf2012-10-041-1/+11
| | | | | Prevent each node from being examined for cleaning multiple times, if it is used in several other nodes
* Merge branch 'dont-clean-phony' of git://github.com/pcc/ninjaEvan Martin2012-04-261-9/+11
|\ | | | | | | | | Conflicts: src/clean.cc
| * Don't delete phony targets when cleaning a specified targetPeter Collingbourne2012-02-281-7/+9
| | | | | | | | Also, modify Cleaner::CleanAll to use Edge::is_phony.
* | Remove depfiles when running when running "ninja -t clean <target>"Qingning Huo2012-03-141-0/+4
|/ | | | or "ninja -t clean -r <rule>"
* Add comments, remove unwanted whitespace changePetr Wolf2012-02-101-1/+1
|
* Response filesunknown2012-02-091-1/+9
|
* Fix the TODO in Rule class.Thiago Farina2011-12-241-1/+1
| | | | | | Move various data members to private section and provide accessors for them. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* make Rule::generator_ and restat_ privateEvan Martin2011-12-071-1/+1
|
* make Rule::name_ privateEvan Martin2011-12-071-5/+6
|
* make Node::in_edge_ privateEvan Martin2011-12-071-3/+3
|
* merge FileStat into NodeEvan Martin2011-12-071-3/+3
| | | | | | The two were always one-to-one anyway. I started adding accessors to FileStat and then realized most users wanted them on Node and that forwarding them through was silly.
* add and use getter for Edge::rule_Evan Martin2011-12-071-3/+3
|
* Have the clean tool remove depfilesPeter Collingbourne2011-12-061-0/+2
|
* Implement generator rulesPeter Collingbourne2011-10-151-1/+4
| | | | | | | | | | | | | Introduce a rule attribute "generator" which, if present, specifies that this rule is used to re-invoke the generator program. Files built using generator rules are treated specially in two ways: firstly, they will not be rebuilt if the command line changes; and secondly, they are not cleaned by default. A command line flag "-g" is introduced for the clean tool, which causes it to remove generator files. Fixes issue #102.
* Make Cleaner::config_ a reference-to-const instead of copying the value.Thiago Farina2011-09-091-1/+0
| | | | Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Factor out State struct from ninja_jumble.cc into its header/source files.Thiago Farina2011-09-031-1/+1
| | | | | | This was a TODO in src/ninja_jumble.cc. Now this task is completed. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Move RealDiskInterface class to disk_interface.h.Thiago Farina2011-08-251-21/+20
| | | | | | This is a TODO in src/ninja_jumble.cc Signed-off-by: Thiago Farina <tfarina@chromium.org>
* clean: don't delete phony targetsEvan Martin2011-06-301-4/+7
| | | | Based on a patch from John Birtley.
* Return non-zero status when errors occur.Nicolas Despres2011-05-021-15/+35
| | | | | | Clean all was not returning non-zero when an error occur (like when failing to remove a directory). This patch fix the problem and add a test for it.
* Add a test for the clean tool.Nicolas Despres2011-05-021-31/+52
| | | | It also fix a bug about the count of removed file reported.
* fix a signedness warningEvan Martin2011-04-291-1/+1
|
* Add the 'clean' tool.Nicolas Despres2011-04-261-0/+190
It removes built files either by rule or target or everything.