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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'): | 109 for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'): |
110 landmines = [] | 110 landmines = [] |
111 for s in options.landmine_scripts: | 111 for s in options.landmine_scripts: |
112 print 'Getting landmines from `%s -t %s`' % (s, target) | |
113 proc = subprocess.Popen([sys.executable, s, '-t', target], | 112 proc = subprocess.Popen([sys.executable, s, '-t', target], |
114 stdout=subprocess.PIPE) | 113 stdout=subprocess.PIPE) |
115 output, _ = proc.communicate() | 114 output, _ = proc.communicate() |
116 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) | 115 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) |
117 set_up_landmines(target, landmines) | 116 set_up_landmines(target, landmines) |
118 | 117 |
119 return 0 | 118 return 0 |
120 | 119 |
121 | 120 |
122 if __name__ == '__main__': | 121 if __name__ == '__main__': |
123 sys.exit(main()) | 122 sys.exit(main()) |
OLD | NEW |