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

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

Issue 1739903002: Revert of md5check'ify lint.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 b326ba81caaf43b55de0b365ffdc4c75a6b45e5e..1e60c2e4d163d0b6f86680d6afe68f2923d155c1 100755
--- a/build/android/gyp/lint.py
+++ b/build/android/gyp/lint.py
@@ -19,9 +19,8 @@
'..', '..', '..'))
-def _OnStaleMd5(changes, lint_path, config_path, processed_config_path,
- manifest_path, result_path, product_dir, sources, jar_path,
- resource_dir=None, can_fail_build=False):
+def _RunLint(lint_path, config_path, processed_config_path, manifest_path,
+ result_path, product_dir, sources, jar_path, resource_dir=None):
def _RelativizePath(path):
"""Returns relative path to top-level src dir.
@@ -72,10 +71,6 @@
print >> sys.stderr, error_line.encode('utf-8')
return len(issues)
- if changes.AddedOrModifiedOnly():
- changed_paths = set(changes.IterChangedPaths())
- sources = [s for s in sources if s in changed_paths]
-
with build_utils.TempDir() as temp_dir:
_ProcessConfigFile()
@@ -126,7 +121,7 @@
if not os.path.exists(result_path):
print 'Something is wrong:'
print e
- raise
+ return 1
# There are actual lint issues
else:
@@ -137,7 +132,7 @@
print 'File contents:'
with open(result_path) as f:
print f.read()
- raise
+ return 1
_ProcessResultFile()
msg = ('\nLint found %d new issues.\n'
@@ -152,8 +147,9 @@
'lint', 'suppress.py')),
_RelativizePath(result_path)))
print >> sys.stderr, msg
- if can_fail_build:
- raise Exception('Lint failed.')
+ return 1
+
+ return 0
def main():
@@ -185,6 +181,8 @@
'result_path', 'product_dir',
'jar_path'])
+ rc = 0
+
if options.enable:
sources = []
if options.src_dirs:
@@ -195,34 +193,21 @@
else:
print 'One of --src-dirs or --java-files must be specified.'
return 1
-
- input_paths = [
- options.lint_path,
- options.config_path,
- options.manifest_path,
- options.jar_path,
- ]
- input_paths.extend(sources)
- if options.resource_dir:
- input_paths.extend(build_utils.FindInDirectory(options.resource_dir, '*'))
-
- input_strings = [ options.processed_config_path ]
- output_paths = [ options.result_path ]
-
- build_utils.CallAndWriteDepfileIfStale(
- lambda changes: _OnStaleMd5(changes, options.lint_path,
- options.config_path,
- options.processed_config_path,
- options.manifest_path, options.result_path,
- options.product_dir, sources,
- options.jar_path,
- resource_dir=options.resource_dir,
- can_fail_build=options.can_fail_build),
- options,
- input_paths=input_paths,
- input_strings=input_strings,
- output_paths=output_paths,
- pass_changes=True)
+ rc = _RunLint(options.lint_path, options.config_path,
+ options.processed_config_path,
+ options.manifest_path, options.result_path,
+ options.product_dir, sources, options.jar_path,
+ options.resource_dir)
+
+ if options.depfile:
+ build_utils.WriteDepfile(
+ options.depfile,
+ build_utils.GetPythonDependencies())
+
+ if options.stamp and not rc:
+ build_utils.Touch(options.stamp)
+
+ return rc if options.can_fail_build else 0
if __name__ == '__main__':
« 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