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

Unified Diff: build/android/gyp/util/build_utils.py

Issue 86313004: [Android] Add lint as a gyp action. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
Index: build/android/gyp/util/build_utils.py
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
index a58fe4a715e552a4a70b0c57a4aee013489f1b5d..1214bbae6566de16de54cc65c88a83f53c4e6d3d 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -78,12 +78,7 @@ def ReadJson(path):
return json.load(jsonfile)
-# This can be used in most cases like subprocess.check_call. The output,
-# particularly when the command fails, better highlights the command's failure.
-# This call will directly exit on a failure in the subprocess so that no python
-# stacktrace is printed after the output of the failed command (and will
-# instead print a python stack trace before the output of the failed command)
-def CheckCallDie(args, suppress_output=False, cwd=None, fail_if_stderr=False):
+def CheckCall(args, suppress_output=False, cwd=None, fail_if_stderr=False):
if not cwd:
cwd = os.getcwd()
@@ -111,16 +106,30 @@ def CheckCallDie(args, suppress_output=False, cwd=None, fail_if_stderr=False):
if stderr:
print >> sys.stderr, stderr,
- # Directly exit to avoid printing stacktrace.
- sys.exit(returncode)
-
else:
if not suppress_output:
if stdout:
print stdout,
if stderr:
print >> sys.stderr, stderr,
- return stdout + stderr
+
+ return (returncode, stdout + stderr)
+
+
+# This can be used in most cases like subprocess.check_call. The output,
+# particularly when the command fails, better highlights the command's failure.
+# This call will directly exit on a failure in the subprocess so that no python
+# stacktrace is printed after the output of the failed command (and will
+# instead print a python stack trace before the output of the failed command)
+def CheckCallDie(args, suppress_output=False, cwd=None, fail_if_stderr=False):
+ returncode, output = CheckCall(args, suppress_output=suppress_output, cwd=cwd,
+ fail_if_stderr=fail_if_stderr)
+
+ if returncode:
+ # Directly exit to avoid printing stacktrace.
+ sys.exit(returncode)
+
+ return output
def GetModifiedTime(path):

Powered by Google App Engine
This is Rietveld 408576698