Implement `gn analyze`.

This CL implements `analyze` natively in GN, fixing some
long-standing issues that the implementation in MB had
due to its not having access to the full build graph.

In particular, `analyze` will now work correctly when given
"all" as a compile target, and the list of compile targets
will now be pruned/filtered correctly.

Note that the input to analyze is different from the input that
MB expects, in that GN expects lists of GN labels and
source-absolute paths to files, rather than lists of ninja
targets and relative paths. MB will be responsible for doing
the conversion until we have updated the build recipes to pass
the format that GN expects.

R=brettw@chromium.org
BUG=555273

Review-Url: https://codereview.chromium.org/2265833002
Cr-Original-Commit-Position: refs/heads/master@{#415050}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6d8fdaabe1a8faed9a5573047a2cebdd8456a996
12 files changed
tree: 48db66bd52f37eb9dd91a595ce91e5b0930f2bfc
  1. tools/