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

Unified Diff: build/android/gyp/lint.py

Issue 982683002: Adds option to allow lint.py script to exit with nonzero exit status (fail builds). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/lint.py
diff --git a/build/android/gyp/lint.py b/build/android/gyp/lint.py
index 953ea547e64981aab07ab461884c2f18e4f93f86..9402780b094d3637943779fa0a61b9a4fe2b0192 100755
--- a/build/android/gyp/lint.py
+++ b/build/android/gyp/lint.py
@@ -20,7 +20,8 @@ _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):
+ result_path, product_dir, sources, jar_path, resource_dir=None,
+ can_fail_build=False):
def _RelativizePath(path):
"""Returns relative path to top-level src dir.
@@ -147,8 +148,7 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
'lint', 'suppress.py')),
_RelativizePath(result_path)))
print >> sys.stderr, msg
- # Lint errors do not fail the build.
- return 0
+ return 1 if can_fail_build else 0
return 0
@@ -167,6 +167,9 @@ def main():
parser.add_option('--java-files', help='Paths to java files.')
parser.add_option('--jar-path', help='Jar file containing class files.')
parser.add_option('--resource-dir', help='Path to resource dir.')
+ parser.add_option('--can-fail-build', action='store_true',
+ help='If set, script will exit with nonzero exit status'
+ ' if lint errors are present')
parser.add_option('--stamp', help='Path to touch on success.')
parser.add_option('--enable', action='store_true',
help='Run lint instead of just touching stamp.')
@@ -195,7 +198,7 @@ def main():
options.processed_config_path,
options.manifest_path, options.result_path,
options.product_dir, sources, options.jar_path,
- options.resource_dir)
+ options.resource_dir, options.can_fail_build)
if options.depfile:
build_utils.WriteDepfile(
« 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