aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/cleanup.go
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/cleanup.go')
-rw-r--r--bootstrap/cleanup.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/bootstrap/cleanup.go b/bootstrap/cleanup.go
index a4a18c7..4a8ce25 100644
--- a/bootstrap/cleanup.go
+++ b/bootstrap/cleanup.go
@@ -30,9 +30,9 @@ const logFileName = ".ninja_log"
// removeAbandonedFilesUnder removes any files that appear in the Ninja log, and
// are prefixed with one of the `under` entries, but that are not currently
-// build targets.
+// build targets, or in `exempt`
func removeAbandonedFilesUnder(ctx *blueprint.Context, config *Config,
- srcDir string, under []string) error {
+ srcDir string, under, exempt []string) error {
if len(under) == 0 {
return nil
@@ -57,6 +57,10 @@ func removeAbandonedFilesUnder(ctx *blueprint.Context, config *Config,
replacedTarget := replacer.Replace(target)
targets[filepath.Clean(replacedTarget)] = true
}
+ for _, target := range exempt {
+ replacedTarget := replacer.Replace(target)
+ targets[filepath.Clean(replacedTarget)] = true
+ }
filePaths, err := parseNinjaLog(ninjaBuildDir, under)
if err != nil {