Improve GN clean command.

Previously it would detect a case where the build.ninja file was empty and write a default
one to replace it. This case is rare and the existing code was broken on Windows because
it used printf on a 16-bit file path. It's simpler to just issue an error in this case.

This also adds a small performance improvement by using StringPiece to split the build file
(saves allocating ~16K strings).

Change-Id: I8a4cb31a9e8614d8d14e821ff24434a57da55212
Reviewed-on: https://chromium-review.googlesource.com/602520
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Brett Wilson <brettw@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#492124}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f99f80fab8249df24e05e686e7b43e2d4ec574b5
1 file changed
tree: 3e2e149df39492b308c30625b47b230f44f6e192
  1. tools/