Commit 2faf2bf5 authored by cjhopman@chromium.org's avatar cjhopman@chromium.org

Enable Android lint by default

BUG=393235

Review URL: https://codereview.chromium.org/447793002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287823 0039d316-1c4b-4281-b951-d872f2087c98
parent 5ca06863
......@@ -158,7 +158,7 @@ def GetBotStepMap():
H(compile_step + std_host_tests, experimental, target_arch='x86')),
B('fyi-builder-dbg',
H(std_build_steps + std_host_tests, experimental,
extra_gyp='emma_coverage=1 android_lint=1')),
extra_gyp='emma_coverage=1')),
B('x86-builder-dbg',
H(compile_step + std_host_tests, target_arch='x86')),
B('fyi-builder-rel', H(std_build_steps, experimental)),
......
......@@ -55,17 +55,15 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
print >> sys.stderr
for issue in issues:
issue_id = issue.attributes['id'].value
severity = issue.attributes['severity'].value
message = issue.attributes['message'].value
location_elem = issue.getElementsByTagName('location')[0]
path = location_elem.attributes['file'].value
line = location_elem.getAttribute('line')
if line:
error = '%s:%s %s: %s [%s]' % (path, line, severity, message,
issue_id)
error = '%s:%s %s: %s [warning]' % (path, line, message, issue_id)
else:
# Issues in class files don't have a line number.
error = '%s %s: %s [%s]' % (path, severity, message, issue_id)
error = '%s %s: %s [warning]' % (path, message, issue_id)
print >> sys.stderr, error
for attr in ['errorLine1', 'errorLine2']:
error_line = issue.getAttribute(attr)
......@@ -90,13 +88,24 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
try:
build_utils.CheckOutput(cmd, cwd=_SRC_ROOT)
except build_utils.CalledProcessError:
except build_utils.CalledProcessError as e:
# There is a problem with lint usage
if not os.path.exists(result_path):
raise
print 'Something is wrong:'
print e
return 0
# There are actual lint issues
else:
num_issues = _ParseAndShowResultFile()
try:
num_issues = _ParseAndShowResultFile()
except Exception:
print 'Lint created unparseable xml file...'
print 'File contents:'
with open(result_path) as f:
print f.read()
return 0
_ProcessResultFile()
msg = ('\nLint found %d new issues.\n'
' - For full explanation refer to %s\n'
......
......@@ -1222,7 +1222,7 @@
'emma_filter%': '',
# Set to 1 to enable running Android lint on java/class files.
'android_lint%': 0,
'android_lint%': 1,
# Although base/allocator lets you select a heap library via an
# environment variable, the libcmt shim it uses sometimes gets in
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment