OLD | NEW |
1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 # This file contains a set of utilities functions used by other Python-based | 5 # This file contains a set of utilities functions used by other Python-based |
6 # scripts. | 6 # scripts. |
7 | 7 |
8 import commands | 8 import commands |
9 import os | 9 import os |
10 import platform | 10 import platform |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 def GetBuildbotGSUtilPath(): | 210 def GetBuildbotGSUtilPath(): |
211 gsutil = '/b/build/scripts/slave/gsutil' | 211 gsutil = '/b/build/scripts/slave/gsutil' |
212 if platform.system() == 'Windows': | 212 if platform.system() == 'Windows': |
213 gsutil = 'e:\\\\b\\build\\scripts\\slave\\gsutil' | 213 gsutil = 'e:\\\\b\\build\\scripts\\slave\\gsutil' |
214 return gsutil | 214 return gsutil |
215 | 215 |
216 def GetBuildMode(mode): | 216 def GetBuildMode(mode): |
217 return BUILD_MODES[mode] | 217 return BUILD_MODES[mode] |
218 | 218 |
219 | 219 def GetBuildConf(mode, arch, conf_os=None): |
220 def GetBuildConf(mode, arch): | 220 if conf_os == 'android': |
221 return '%s%s' % (GetBuildMode(mode), arch.upper()) | 221 return '%s%s%s' % (GetBuildMode(mode), conf_os.title(), arch.upper()) |
| 222 else: |
| 223 return '%s%s' % (GetBuildMode(mode), arch.upper()) |
222 | 224 |
223 ARCH_GUESS = GuessArchitecture() | 225 ARCH_GUESS = GuessArchitecture() |
224 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..')) | 226 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..')) |
225 DART_DIR = os.path.abspath(os.path.join(__file__, '..', '..')) | 227 DART_DIR = os.path.abspath(os.path.join(__file__, '..', '..')) |
226 | 228 |
227 | 229 |
228 def GetBuildDir(host_os, target_os): | 230 def GetBuildDir(host_os, target_os): |
229 build_dir = BUILD_ROOT[host_os] | 231 return BUILD_ROOT[host_os] |
230 if target_os and target_os != host_os: | |
231 build_dir = os.path.join(build_dir, target_os) | |
232 return build_dir | |
233 | 232 |
234 def GetBuildRoot(host_os, mode=None, arch=None, target_os=None): | 233 def GetBuildRoot(host_os, mode=None, arch=None, target_os=None): |
235 build_root = GetBuildDir(host_os, target_os) | 234 build_root = GetBuildDir(host_os, target_os) |
236 if mode: | 235 if mode: |
237 build_root = os.path.join(build_root, GetBuildConf(mode, arch)) | 236 build_root = os.path.join(build_root, GetBuildConf(mode, arch)) |
238 return build_root | 237 return build_root |
239 | 238 |
240 def GetBaseDir(): | 239 def GetBaseDir(): |
241 return BASE_DIR | 240 return BASE_DIR |
242 | 241 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 os.chdir(self._working_directory) | 526 os.chdir(self._working_directory) |
528 | 527 |
529 def __exit__(self, *_): | 528 def __exit__(self, *_): |
530 print "Enter directory = ", self._old_cwd | 529 print "Enter directory = ", self._old_cwd |
531 os.chdir(self._old_cwd) | 530 os.chdir(self._old_cwd) |
532 | 531 |
533 | 532 |
534 if __name__ == "__main__": | 533 if __name__ == "__main__": |
535 import sys | 534 import sys |
536 Main(sys.argv) | 535 Main(sys.argv) |
OLD | NEW |