Skip to content

Commit

Permalink
Implement gn analyze.
Browse files Browse the repository at this point in the history
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-Commit-Position: refs/heads/master@{#415050}
  • Loading branch information
dpranke authored and Commit bot committed Aug 30, 2016
1 parent 7a572e0 commit 6d8fdaa
Show file tree
Hide file tree
Showing 12 changed files with 925 additions and 11 deletions.
4 changes: 4 additions & 0 deletions tools/gn/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ static_library("gn_lib") {
"action_target_generator.h",
"action_values.cc",
"action_values.h",
"analyzer.cc",
"analyzer.h",
"args.cc",
"args.h",
"binary_target_generator.cc",
Expand All @@ -33,6 +35,7 @@ static_library("gn_lib") {
"bundle_file_rule.h",
"c_include_iterator.cc",
"c_include_iterator.h",
"command_analyze.cc",
"command_args.cc",
"command_check.cc",
"command_clean.cc",
Expand Down Expand Up @@ -274,6 +277,7 @@ executable("gn") {
test("gn_unittests") {
sources = [
"action_target_generator_unittest.cc",
"analyzer_unittest.cc",
"args_unittest.cc",
"builder_unittest.cc",
"c_include_iterator_unittest.cc",
Expand Down
Loading

0 comments on commit 6d8fdaa

Please sign in to comment.