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

Side by Side Diff: trunk/src/build/android/gyp/lint.py

Issue 134923003: Revert 244256 "[Android] Enable lint warnings by default." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « trunk/src/build/android/buildbot/bb_run_bot.py ('k') | trunk/src/build/common.gypi » ('j') | 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 (c) 2013 The Chromium Authors. All rights reserved. 3 # Copyright (c) 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 """Runs Android's lint tool.""" 7 """Runs Android's lint tool."""
8 8
9 9
10 import optparse 10 import optparse
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 with open(result_path, 'wb') as f: 49 with open(result_path, 'wb') as f:
50 f.write(content) 50 f.write(content)
51 51
52 def _ParseAndShowResultFile(): 52 def _ParseAndShowResultFile():
53 dom = minidom.parse(result_path) 53 dom = minidom.parse(result_path)
54 issues = dom.getElementsByTagName('issue') 54 issues = dom.getElementsByTagName('issue')
55 print >> sys.stderr 55 print >> sys.stderr
56 for issue in issues: 56 for issue in issues:
57 issue_id = issue.attributes['id'].value 57 issue_id = issue.attributes['id'].value
58 severity = issue.attributes['severity'].value
58 message = issue.attributes['message'].value 59 message = issue.attributes['message'].value
59 location_elem = issue.getElementsByTagName('location')[0] 60 location_elem = issue.getElementsByTagName('location')[0]
60 path = location_elem.attributes['file'].value 61 path = location_elem.attributes['file'].value
61 line = location_elem.getAttribute('line') 62 line = location_elem.getAttribute('line')
62 if line: 63 if line:
63 error = '%s:%s %s: %s [warning]' % (path, line, message, issue_id) 64 error = '%s:%s %s: %s [%s]' % (path, line, severity, message,
65 issue_id)
64 else: 66 else:
65 # Issues in class files don't have a line number. 67 # Issues in class files don't have a line number.
66 error = '%s %s: %s [warning]' % (path, message, issue_id) 68 error = '%s %s: %s [%s]' % (path, severity, message, issue_id)
67 print >> sys.stderr, error 69 print >> sys.stderr, error
68 for attr in ['errorLine1', 'errorLine2']: 70 for attr in ['errorLine1', 'errorLine2']:
69 error_line = issue.getAttribute(attr) 71 error_line = issue.getAttribute(attr)
70 if error_line: 72 if error_line:
71 print >> sys.stderr, error_line 73 print >> sys.stderr, error_line
72 return len(issues) 74 return len(issues)
73 75
74 _ProcessConfigFile() 76 _ProcessConfigFile()
75 77
76 cmd = [ 78 cmd = [
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 options.product_dir, src_dirs, options.classes_dir) 150 options.product_dir, src_dirs, options.classes_dir)
149 151
150 if options.stamp and not rc: 152 if options.stamp and not rc:
151 build_utils.Touch(options.stamp) 153 build_utils.Touch(options.stamp)
152 154
153 return rc 155 return rc
154 156
155 157
156 if __name__ == '__main__': 158 if __name__ == '__main__':
157 sys.exit(main(sys.argv)) 159 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « trunk/src/build/android/buildbot/bb_run_bot.py ('k') | trunk/src/build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698