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

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

Issue 977253002: Silence uninteresting proguard output. (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/proguard.py
diff --git a/build/android/gyp/proguard.py b/build/android/gyp/proguard.py
index ca5877051be72630c44cda7eeb54920db6722bbf..cb547fb97043a091b41370762830618c8dacc33b 100755
--- a/build/android/gyp/proguard.py
+++ b/build/android/gyp/proguard.py
@@ -28,7 +28,31 @@ def DoProguard(options):
'-outjars', outjars,
'-libraryjars', libraryjars,
'@' + options.proguard_config]
- build_utils.CheckOutput(proguard_cmd, print_stdout=True)
+ build_utils.CheckOutput(proguard_cmd, print_stdout=True,
+ stdout_filter=FilterProguardOutput)
+
+
+def FilterProguardOutput(output):
+ '''ProGuard outputs boring stuff to stdout (proguard version, jar path, etc)
+ as well as interesting stuff (notes, warnings, etc). If stdout is entirely
+ boring, this method suppresses the output.
+ '''
+ ignore_patterns = [
+ 'ProGuard, version ',
+ 'Reading program jar [',
+ 'Reading library jar [',
+ 'Preparing output jar [',
+ ' Copying resources from program jar [',
+ ]
+ for line in output.splitlines():
+ for pattern in ignore_patterns:
+ if line.startswith(pattern):
+ break
+ else:
+ # line doesn't match any of the patterns; it's probably something worth
+ # printing out.
+ return output
+ return ''
def main(args):
« 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