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

Side by Side Diff: scripts/common/annotator.py

Issue 14602020: Add an AOSP builder recipe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Contains generating and parsing systems of the Chromium Buildbot Annotator. 6 """Contains generating and parsing systems of the Chromium Buildbot Annotator.
7 7
8 When executed as a script, this reads step name / command pairs from a file and 8 When executed as a script, this reads step name / command pairs from a file and
9 executes those lines while annotating the output. The input is json: 9 executes those lines while annotating the output. The input is json:
10 10
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 class AnnotationFilter(chromium_utils.RunCommandFilter): 373 class AnnotationFilter(chromium_utils.RunCommandFilter):
374 def FilterLine(self, line): 374 def FilterLine(self, line):
375 return line.replace('@@@', '###') 375 return line.replace('@@@', '###')
376 filter_obj = AnnotationFilter() 376 filter_obj = AnnotationFilter()
377 377
378 try: 378 try:
379 with stream.step(name) as s: 379 with stream.step(name) as s:
380 ret = chromium_utils.RunCommand(command=map(str, cmd), 380 ret = chromium_utils.RunCommand(command=map(str, cmd),
381 cwd=cwd, 381 cwd=cwd,
382 env=_merge_envs(os.environ, env), 382 env=_merge_envs(os.environ, env),
383 filter_obj=filter_obj) 383 filter_obj=filter_obj,
384 pipes=step_dict.get('pipes'))
384 if ret != 0: 385 if ret != 0:
385 print 'step returned non-zero exit code: %d' % ret 386 print 'step returned non-zero exit code: %d' % ret
386 print 'step was: %s' % json.dumps(step_dict) 387 print 'step was: %s' % json.dumps(step_dict)
387 s.step_failure() 388 s.step_failure()
388 build_failure = True 389 build_failure = True
389 except OSError: 390 except OSError:
390 # File wasn't found, error has been already reported to stream. 391 # File wasn't found, error has been already reported to stream.
391 build_failure = True 392 build_failure = True
392 393
393 return build_failure 394 return build_failure
(...skipping 24 matching lines...) Expand all
418 419
419 stream = StructuredAnnotationStream(seed_steps=[s['name'] for s in steps]) 420 stream = StructuredAnnotationStream(seed_steps=[s['name'] for s in steps])
420 build_failure = False 421 build_failure = False
421 for step in steps: 422 for step in steps:
422 build_failure = _run_step(stream, build_failure, **step) 423 build_failure = _run_step(stream, build_failure, **step)
423 return 1 if build_failure else 0 424 return 1 if build_failure else 0
424 425
425 426
426 if __name__ == '__main__': 427 if __name__ == '__main__':
427 sys.exit(main()) 428 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/annotated_run.py » ('j') | scripts/slave/recipes/android_webview_aosp.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698