Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """ | 6 """ |
| 7 This script runs every build as a hook. If it detects that the build should | 7 This script runs every build as a hook. If it detects that the build should |
| 8 be clobbered, it will touch the file <build_dir>/.landmine_triggered. The | 8 be clobbered, it will touch the file <build_dir>/.landmine_triggered. The |
| 9 various build scripts will then check for the presence of this file and clobber | 9 various build scripts will then check for the presence of this file and clobber |
| 10 accordingly. The script will also emit the reasons for the clobber to stdout. | 10 accordingly. The script will also emit the reasons for the clobber to stdout. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 options, args = parser.parse_args() | 99 options, args = parser.parse_args() |
| 100 | 100 |
| 101 if args: | 101 if args: |
| 102 parser.error('Unknown arguments %s' % args) | 102 parser.error('Unknown arguments %s' % args) |
| 103 | 103 |
| 104 logging.basicConfig( | 104 logging.basicConfig( |
| 105 level=logging.DEBUG if options.verbose else logging.ERROR) | 105 level=logging.DEBUG if options.verbose else logging.ERROR) |
| 106 | 106 |
| 107 gyp_helper.apply_chromium_gyp_env() | 107 gyp_helper.apply_chromium_gyp_env() |
| 108 | 108 |
| 109 extra_script = os.environ.get('EXTRA_LANDMINES_SCRIPT') | |
| 110 if extra_script: | |
| 111 options.landmine_scripts.append(extra_script) | |
|
iannucci
2013/08/31 00:54:20
I would put this above the apply_chromium_gyp_env.
| |
| 109 for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'): | 112 for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'): |
| 110 landmines = [] | 113 landmines = [] |
| 111 for s in options.landmine_scripts: | 114 for s in options.landmine_scripts: |
| 112 proc = subprocess.Popen([sys.executable, s, '-t', target], | 115 proc = subprocess.Popen([sys.executable, s, '-t', target], |
| 113 stdout=subprocess.PIPE) | 116 stdout=subprocess.PIPE) |
| 114 output, _ = proc.communicate() | 117 output, _ = proc.communicate() |
| 115 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) | 118 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) |
| 119 | |
| 116 set_up_landmines(target, landmines) | 120 set_up_landmines(target, landmines) |
| 117 | 121 |
| 118 return 0 | 122 return 0 |
| 119 | 123 |
| 120 | 124 |
| 121 if __name__ == '__main__': | 125 if __name__ == '__main__': |
| 122 sys.exit(main()) | 126 sys.exit(main()) |
| OLD | NEW |