Make MB clobber build directories when switching between GYP and GN.
commitc161aa945c811b260f7f2981e592f63d16c3a106
authordpranke <dpranke@chromium.org>
Mon, 14 Sep 2015 20:21:13 +0000 (14 13:21 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 14 Sep 2015 20:21:57 +0000 (14 20:21 +0000)
tree6ab9561cc99545d63fe80a77c51f0246299d296e
parentd811c1c7e09531d9fe0ed960e99070c24f134d05
Make MB clobber build directories when switching between GYP and GN.

GYP and GN put generated files in different places inside the build
directory. This means that if you do a GYP build and then a GN build
into the same directory, you may get unpredictable results depending
on which generated files are picked up at what times.

In order to avoid this, we modify MB to keep track of whether a
given build directory has build files generated by GYP or GN; if there
is a mismatch (like when we flip a bot from GYP to GN), we clobber the
build directory and start from scratch to be safe.

In addition, the first time we enable MB on a bot, we will not know
what the existing build directory contains; to be safe, we do a clobber
in this situation as well.

R=brettw@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1338123002

Cr-Commit-Position: refs/heads/master@{#348705}
tools/mb/mb.py
tools/mb/mb_unittest.py