summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authoraurimas <aurimas@chromium.org>2015-06-19 15:38:49 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-19 22:39:24 +0000
commit8db283ac6beb49ad8032a8e6c65e4cc76db65ffd (patch)
treeea21835e333b63fb0a6771a03b675b7d43d4fb6e /build
parent2f27f9bf85b21f149c5972197ef07f957fe20b41 (diff)
downloadchromium_src-8db283ac6beb49ad8032a8e6c65e4cc76db65ffd.zip
chromium_src-8db283ac6beb49ad8032a8e6c65e4cc76db65ffd.tar.gz
chromium_src-8db283ac6beb49ad8032a8e6c65e4cc76db65ffd.tar.bz2
Make lint fail builds.
Fix and suppress a bunch of lint warnings to be able to enable lint build failing. TBR=boliu@chromium.org,pauljensen@chromium.org,tedchoc@chromium.org,lambroslambrou@chromium.org,damienv@chromium.org BUG=501471,241521,501591,501593,501900,502030 Review URL: https://codereview.chromium.org/1190103002 Cr-Commit-Position: refs/heads/master@{#335371}
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/gyp/lint.py13
-rw-r--r--build/android/lint/suppressions.xml11
-rw-r--r--build/android/lint_action.gypi1
3 files changed, 17 insertions, 8 deletions
diff --git a/build/android/gyp/lint.py b/build/android/gyp/lint.py
index 9402780..6c4645a 100755
--- a/build/android/gyp/lint.py
+++ b/build/android/gyp/lint.py
@@ -20,8 +20,7 @@ _SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__),
def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
- result_path, product_dir, sources, jar_path, resource_dir=None,
- can_fail_build=False):
+ result_path, product_dir, sources, jar_path, resource_dir=None):
def _RelativizePath(path):
"""Returns relative path to top-level src dir.
@@ -122,7 +121,7 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
if not os.path.exists(result_path):
print 'Something is wrong:'
print e
- return 0
+ return 1
# There are actual lint issues
else:
@@ -133,7 +132,7 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
print 'File contents:'
with open(result_path) as f:
print f.read()
- return 0
+ return 1
_ProcessResultFile()
msg = ('\nLint found %d new issues.\n'
@@ -148,7 +147,7 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
'lint', 'suppress.py')),
_RelativizePath(result_path)))
print >> sys.stderr, msg
- return 1 if can_fail_build else 0
+ return 1
return 0
@@ -198,7 +197,7 @@ def main():
options.processed_config_path,
options.manifest_path, options.result_path,
options.product_dir, sources, options.jar_path,
- options.resource_dir, options.can_fail_build)
+ options.resource_dir)
if options.depfile:
build_utils.WriteDepfile(
@@ -208,7 +207,7 @@ def main():
if options.stamp and not rc:
build_utils.Touch(options.stamp)
- return rc
+ return rc if options.can_fail_build else 0
if __name__ == '__main__':
diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml
index 24b0846..4f10aa8 100644
--- a/build/android/lint/suppressions.xml
+++ b/build/android/lint/suppressions.xml
@@ -53,10 +53,14 @@ Still reading?
<ignore path="ui/android/java/res/drawable-xxxhdpi"/>
<ignore regexp=".*: reader_mode_bar_background.9.png, tabs_moved_htc.png, tabs_moved_nexus.png, tabs_moved_samsung.png$"/>
</issue>
- <!-- It is OK for content_shell_apk and chrome_shell_apk to have missing assets. -->
<issue id="IconLocation">
+ <!-- It is OK for content_shell_apk and chrome_shell_apk to have missing assets. -->
<ignore path="content/shell/android/java/res/"/>
<ignore path="chrome/android/shell/res/"/>
+ <!-- Suppression for chrome/test/chromedriver/test/webview_shell/java/res/drawable/icon.png -->
+ <ignore path="res/drawable/icon.png"/>
+ <!-- TODO(lambroslambrou) remove this once crbug.com/502030 is fixed. -->
+ <ignore path="remoting/android/java/res"/>
</issue>
<issue id="InconsistentLayout" severity="ignore"/>
<issue id="InflateParams" severity="ignore"/>
@@ -73,11 +77,14 @@ Still reading?
<ignore path="org/chromium/base/SysUtils.class"/>
<ignore path="org/chromium/chrome/browser/TtsPlatformImpl.class"/>
<ignore path="org/chromium/chrome/browser/TtsPlatformImpl$*.class"/>
+ <ignore path="chrome/android/java/res/values-v17/styles.xml"/>
</issue>
<issue id="OldTargetApi">
<ignore path="AndroidManifest.xml"/>
</issue>
<issue id="Overdraw" severity="ignore"/>
+ <!-- TODO(newt): remove if INJECT_EVENTS is not needed crbug.com/502028 -->
+ <issue id="ProtectedPermissions" severity="ignore"/>
<issue id="Recycle" severity="ignore"/>
<issue id="Registered" severity="ignore"/>
<issue id="RtlCompat" severity="ignore"/>
@@ -93,6 +100,8 @@ Still reading?
targets have been merged. crbug.com/484934
-->
<ignore path="chrome/android/java/res" />
+ <ignore path="content/shell/android/shell_apk/res/layout/content_shell_activity.xml" />
+ <ignore path="content/shell/android/shell_apk/res/values/strings.xml" />
</issue>
<issue id="SignatureOrSystemPermissions" severity="ignore"/>
<issue id="UnusedAttribute" severity="ignore"/>
diff --git a/build/android/lint_action.gypi b/build/android/lint_action.gypi
index e042130..e1adf1f 100644
--- a/build/android/lint_action.gypi
+++ b/build/android/lint_action.gypi
@@ -36,6 +36,7 @@
'--product-dir=<(PRODUCT_DIR)',
'--src-dirs=>(src_dirs)',
'--jar-path=<(lint_jar_path)',
+ '--can-fail-build',
'--stamp=<(stamp_path)',
'<(is_enabled)',
],