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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/gyp/push_libraries.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import fnmatch 5 import fnmatch
6 import json 6 import json
7 import os 7 import os
8 import pipes 8 import pipes
9 import shlex 9 import shlex
10 import shutil 10 import shutil
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 outfile.write(new_dump) 74 outfile.write(new_dump)
75 75
76 def ReadJson(path): 76 def ReadJson(path):
77 with open(path, 'r') as jsonfile: 77 with open(path, 'r') as jsonfile:
78 return json.load(jsonfile) 78 return json.load(jsonfile)
79 79
80 80
81 # This can be used in most cases like subprocess.check_call. The output, 81 # This can be used in most cases like subprocess.check_call. The output,
82 # particularly when the command fails, better highlights the command's failure. 82 # particularly when the command fails, better highlights the command's failure.
83 # This call will directly exit on a failure in the subprocess so that no python 83 # This call will directly exit on a failure in the subprocess so that no python
84 # stacktrace is printed after the output of the failed command. 84 # stacktrace is printed after the output of the failed command (and will
85 # instead print a python stack trace before the output of the failed command)
85 def CheckCallDie(args, suppress_output=False, cwd=None): 86 def CheckCallDie(args, suppress_output=False, cwd=None):
86 if not cwd: 87 if not cwd:
87 cwd = os.getcwd() 88 cwd = os.getcwd()
88 89
89 child = subprocess.Popen(args, 90 child = subprocess.Popen(args,
90 stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd) 91 stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd)
91 92
92 stdout, _ = child.communicate() 93 stdout, _ = child.communicate()
93 94
94 if child.returncode: 95 if child.returncode:
(...skipping 26 matching lines...) Expand all
121 122
122 def IsTimeStale(output, inputs): 123 def IsTimeStale(output, inputs):
123 if not os.path.exists(output): 124 if not os.path.exists(output):
124 return True 125 return True
125 126
126 output_time = GetModifiedTime(output) 127 output_time = GetModifiedTime(output)
127 for input in inputs: 128 for input in inputs:
128 if GetModifiedTime(input) > output_time: 129 if GetModifiedTime(input) > output_time:
129 return True 130 return True
130 return False 131 return False
132
133
134 def IsDeviceReady():
135 device_state = CheckCallDie(['adb', 'get-state'], suppress_output=True)
136 return device_state.strip() == 'device'
137
138
139 def PrintWarning(message):
140 print 'WARNING: ' + message
141
142
143 def PrintBigWarning(message):
144 print '***** ' * 8
145 PrintWarning(message)
146 print '***** ' * 8
OLDNEW
« 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