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

Side by Side Diff: build/android/gyp/javac.py

Issue 1407043010: GN(android): Add work-around for "project database corrupted" error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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).
Yaron 2015/11/04 16:45:13 yowza - now that's a hack! There's also no guarant
agrieve 2015/11/04 18:20:22 It should always work the second time since there
250 if 'project database corrupted' in e.output:
251 os.unlink(pdb_path)
252 attempt_build()
246 253
247 if options.main_class or options.manifest_entry: 254 if options.main_class or options.manifest_entry:
248 entries = [] 255 entries = []
249 if options.manifest_entry: 256 if options.manifest_entry:
250 entries = [e.split(':') for e in options.manifest_entry] 257 entries = [e.split(':') for e in options.manifest_entry]
251 manifest_file = os.path.join(temp_dir, 'manifest') 258 manifest_file = os.path.join(temp_dir, 'manifest')
252 _CreateManifest(manifest_file, runtime_classpath, options.main_class, 259 _CreateManifest(manifest_file, runtime_classpath, options.main_class,
253 entries) 260 entries)
254 else: 261 else:
255 manifest_file = None 262 manifest_file = None
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 options, 445 options,
439 input_paths=input_paths, 446 input_paths=input_paths,
440 input_strings=javac_cmd, 447 input_strings=javac_cmd,
441 output_paths=output_paths, 448 output_paths=output_paths,
442 force=force, 449 force=force,
443 pass_changes=True) 450 pass_changes=True)
444 451
445 452
446 if __name__ == '__main__': 453 if __name__ == '__main__':
447 sys.exit(main(sys.argv[1:])) 454 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698