mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Add json output arg to mb gen and analyze.
Allows writing of output error to json output path specified. Bug: chromium:985959 Change-Id: I93205451d3537072607b2a243e9a5216ae231099 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146273 Commit-Queue: Debrian Figueroa <debrian@google.com> Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Reviewed-by: Dirk Pranke <dpranke@google.com> Cr-Commit-Position: refs/heads/master@{#28639}
This commit is contained in:
parent
97273d011a
commit
3f53edbe5e
1 changed files with 12 additions and 2 deletions
|
@ -121,6 +121,8 @@ class MetaBuildWrapper(object):
|
|||
subp.add_argument('output_path', nargs=1,
|
||||
help='path to a file containing the output arguments '
|
||||
'as a JSON object.')
|
||||
subp.add_argument('--json-output',
|
||||
help='Write errors to json.output')
|
||||
subp.set_defaults(func=self.CmdAnalyze)
|
||||
|
||||
subp = subps.add_parser('export',
|
||||
|
@ -139,6 +141,8 @@ class MetaBuildWrapper(object):
|
|||
subp.add_argument('--swarming-targets-file',
|
||||
help='save runtime dependencies for targets listed '
|
||||
'in file.')
|
||||
subp.add_argument('--json-output',
|
||||
help='Write errors to json.output')
|
||||
subp.add_argument('path', nargs=1,
|
||||
help='path to generate build into')
|
||||
subp.set_defaults(func=self.CmdGen)
|
||||
|
@ -613,8 +617,11 @@ class MetaBuildWrapper(object):
|
|||
self.WriteFile(gn_runtime_deps_path, '\n'.join(labels) + '\n')
|
||||
cmd.append('--runtime-deps-list-file=%s' % gn_runtime_deps_path)
|
||||
|
||||
ret, _, _ = self.Run(cmd)
|
||||
ret, output, _ = self.Run(cmd)
|
||||
if ret:
|
||||
if self.args.json_output:
|
||||
# write errors to json.output
|
||||
self.WriteJSON({'output': output}, self.args.json_output)
|
||||
# If `gn gen` failed, we should exit early rather than trying to
|
||||
# generate isolates. Run() will have already logged any error output.
|
||||
self.Print('GN gen failed: %d' % ret)
|
||||
|
@ -966,8 +973,11 @@ class MetaBuildWrapper(object):
|
|||
try:
|
||||
self.WriteJSON(gn_inp, gn_input_path)
|
||||
cmd = self.GNCmd('analyze', build_path, gn_input_path, gn_output_path)
|
||||
ret, _, _ = self.Run(cmd, force_verbose=True)
|
||||
ret, output, _ = self.Run(cmd, force_verbose=True)
|
||||
if ret:
|
||||
if self.args.json_output:
|
||||
# write errors to json.output
|
||||
self.WriteJSON({'output': output}, self.args.json_output)
|
||||
return ret
|
||||
|
||||
gn_outp_str = self.ReadFile(gn_output_path)
|
||||
|
|
Loading…
Reference in a new issue