diff options
author | mikecase <mikecase@chromium.org> | 2015-03-06 11:48:56 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-06 19:49:46 +0000 |
commit | 2b6f0c85fc4dcdb1746c4ac717b4b71c96e6e22a (patch) | |
tree | d101613c7b3f715f0151a8f519b85a64b5e02932 | |
parent | 9547d1f683be7c99e28054d7cc78ffcc2be2ccff (diff) | |
download | chromium_src-2b6f0c85fc4dcdb1746c4ac717b4b71c96e6e22a.zip chromium_src-2b6f0c85fc4dcdb1746c4ac717b4b71c96e6e22a.tar.gz chromium_src-2b6f0c85fc4dcdb1746c4ac717b4b71c96e6e22a.tar.bz2 |
Adds option to allow lint.py script to exit with nonzero exit status (fail builds).
We want to remove downstream lint script. We will need this script to be able to fail
builds if we want to replace the downstream script with this one.
BUG=266140
Review URL: https://codereview.chromium.org/982683002
Cr-Commit-Position: refs/heads/master@{#319481}
-rwxr-xr-x | build/android/gyp/lint.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/build/android/gyp/lint.py b/build/android/gyp/lint.py index 953ea54..9402780 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( |