OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import optparse | 7 import optparse |
8 import os | 8 import os |
9 import shutil | 9 import shutil |
10 import re | 10 import re |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 # Don't include the output directory in the initial set of args since it | 231 # Don't include the output directory in the initial set of args since it |
232 # being in a temp dir makes it unstable (breaks md5 stamping). | 232 # being in a temp dir makes it unstable (breaks md5 stamping). |
233 cmd = javac_cmd + ['-d', classes_dir] + java_files | 233 cmd = javac_cmd + ['-d', classes_dir] + java_files |
234 | 234 |
235 # JMake prints out some diagnostic logs that we want to ignore. | 235 # JMake prints out some diagnostic logs that we want to ignore. |
236 # This assumes that all compiler output goes through stderr. | 236 # This assumes that all compiler output goes through stderr. |
237 stdout_filter = lambda s: '' | 237 stdout_filter = lambda s: '' |
238 if md5_check.PRINT_EXPLANATIONS: | 238 if md5_check.PRINT_EXPLANATIONS: |
239 stdout_filter = None | 239 stdout_filter = None |
240 | 240 |
241 build_utils.CheckOutput( | 241 attempt_build = lambda: build_utils.CheckOutput( |
242 cmd, | 242 cmd, |
243 print_stdout=options.chromium_code, | 243 print_stdout=options.chromium_code, |
244 stdout_filter=stdout_filter, | 244 stdout_filter=stdout_filter, |
245 stderr_filter=ColorJavacOutput) | 245 stderr_filter=ColorJavacOutput) |
246 try: | |
247 attempt_build() | |
248 except build_utils.CalledProcessError as e: | |
249 # Work-around for a bug in jmake (http://crbug.com/551449). | |
250 if 'project database corrupted' not in e.output: | |
251 raise | |
252 print ('Applying work-around for jmake project database corrupted ' | |
253 '(http://crbug.com/551449).') | |
254 os.unlink(pdb_path) | |
255 attempt_build() | |
jbudorick
2015/11/05 20:47:45
Why was the second build not causing failures befo
agrieve
2015/11/05 21:02:10
It was not re-raising the exception :(
| |
246 | 256 |
247 if options.main_class or options.manifest_entry: | 257 if options.main_class or options.manifest_entry: |
248 entries = [] | 258 entries = [] |
249 if options.manifest_entry: | 259 if options.manifest_entry: |
250 entries = [e.split(':') for e in options.manifest_entry] | 260 entries = [e.split(':') for e in options.manifest_entry] |
251 manifest_file = os.path.join(temp_dir, 'manifest') | 261 manifest_file = os.path.join(temp_dir, 'manifest') |
252 _CreateManifest(manifest_file, runtime_classpath, options.main_class, | 262 _CreateManifest(manifest_file, runtime_classpath, options.main_class, |
253 entries) | 263 entries) |
254 else: | 264 else: |
255 manifest_file = None | 265 manifest_file = None |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 options, | 448 options, |
439 input_paths=input_paths, | 449 input_paths=input_paths, |
440 input_strings=javac_cmd, | 450 input_strings=javac_cmd, |
441 output_paths=output_paths, | 451 output_paths=output_paths, |
442 force=force, | 452 force=force, |
443 pass_changes=True) | 453 pass_changes=True) |
444 | 454 |
445 | 455 |
446 if __name__ == '__main__': | 456 if __name__ == '__main__': |
447 sys.exit(main(sys.argv[1:])) | 457 sys.exit(main(sys.argv[1:])) |
OLD | NEW |