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

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

Issue 13877025: [Android] With gyp_managed_install no device is only a warning (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « build/android/gyp/push_libraries.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b8b94622d910ef41ea998567d3c10416b8fcf264..897b6fc94917ff899a46976efb08fb4799dab203 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -81,7 +81,8 @@ def ReadJson(path):
# 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.
+# 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):
if not cwd:
cwd = os.getcwd()
@@ -128,3 +129,18 @@ def IsTimeStale(output, inputs):
if GetModifiedTime(input) > output_time:
return True
return False
+
+
+def IsDeviceReady():
+ device_state = CheckCallDie(['adb', 'get-state'], suppress_output=True)
+ return device_state.strip() == 'device'
+
+
+def PrintWarning(message):
+ print 'WARNING: ' + message
+
+
+def PrintBigWarning(message):
+ print '***** ' * 8
+ PrintWarning(message)
+ print '***** ' * 8
« no previous file with comments | « build/android/gyp/push_libraries.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698