Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: tools/mb/mb.py

Issue 1135743005: Modify the gn version of 'mb analyze' to handle GN group targets as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mb_response_file
Patch Set: add the input target, not the build target, to the list of matches Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/mb/mb.py
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index b28bb5c369984ae2ce85392ed33c2ec7c23052fb..3ba59438984fbb8a0364102cf1957a3f563e8ec0 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -429,9 +429,7 @@ class MetaBuildWrapper(object):
matching_targets = []
try:
cmd = self.GNCmd('refs', self.args.path[0]) + [
- '@%s' % response_file.name,
- '--type=executable', '--all', '--as=output'
- ]
+ '@%s' % response_file.name, '--all', '--as=output']
ret, out, _ = self.Run(cmd)
if ret and not 'The input matches no targets' in out:
self.WriteFailureAndRaise('gn refs returned %d: %s' % (ret, out),
@@ -441,6 +439,22 @@ class MetaBuildWrapper(object):
build_output = output.replace(build_dir, '')
if build_output in inp['targets']:
matching_targets.append(build_output)
+
+ cmd = self.GNCmd('refs', self.args.path[0]) + [
+ '@%s' % response_file.name, '--all']
+ ret, out, _ = self.Run(cmd)
+ if ret and not 'The input matches no targets' in out:
+ self.WriteFailureAndRaise('gn refs returned %d: %s' % (ret, out),
+ output_path)
+ for label in out.splitlines():
+ build_target = label[2:]
+ # We want to accept 'chrome/android:chrome_shell_apk' and
+ # just 'chrome_shell_apk'. This may result in too many targets
+ # getting built, but we can adjust that later if need be.
+ for input_target in inp['targets']:
+ if (input_target == build_target or
+ build_target.endswith(':' + input_target)):
+ matching_targets.append(input_target)
finally:
self.RemoveFile(response_file.name)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698