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 attempt_build = lambda: build_utils.CheckOutput( | 241 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' in e.output: | |
251 print ('Applying work-around for jmake project database corrupted ' | |
252 '(http://crbug.com/551449).') | |
253 os.unlink(pdb_path) | |
254 attempt_build() | |
255 | 246 |
256 if options.main_class or options.manifest_entry: | 247 if options.main_class or options.manifest_entry: |
257 entries = [] | 248 entries = [] |
258 if options.manifest_entry: | 249 if options.manifest_entry: |
259 entries = [e.split(':') for e in options.manifest_entry] | 250 entries = [e.split(':') for e in options.manifest_entry] |
260 manifest_file = os.path.join(temp_dir, 'manifest') | 251 manifest_file = os.path.join(temp_dir, 'manifest') |
261 _CreateManifest(manifest_file, runtime_classpath, options.main_class, | 252 _CreateManifest(manifest_file, runtime_classpath, options.main_class, |
262 entries) | 253 entries) |
263 else: | 254 else: |
264 manifest_file = None | 255 manifest_file = None |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 options, | 438 options, |
448 input_paths=input_paths, | 439 input_paths=input_paths, |
449 input_strings=javac_cmd, | 440 input_strings=javac_cmd, |
450 output_paths=output_paths, | 441 output_paths=output_paths, |
451 force=force, | 442 force=force, |
452 pass_changes=True) | 443 pass_changes=True) |
453 | 444 |
454 | 445 |
455 if __name__ == '__main__': | 446 if __name__ == '__main__': |
456 sys.exit(main(sys.argv[1:])) | 447 sys.exit(main(sys.argv[1:])) |
OLD | NEW |