| OLD | NEW |
| 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2011, 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 def GetBuildConf(mode, arch): | 130 def GetBuildConf(mode, arch): |
| 131 return GetBuildMode(mode) + "_" + arch | 131 return GetBuildMode(mode) + "_" + arch |
| 132 | 132 |
| 133 ARCH_GUESS = GuessArchitecture() | 133 ARCH_GUESS = GuessArchitecture() |
| 134 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..')) | 134 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..')) |
| 135 | 135 |
| 136 def GetBuildRoot(target_os, mode=None, arch=None): | 136 def GetBuildRoot(target_os, mode=None, arch=None): |
| 137 global BUILD_ROOT | 137 global BUILD_ROOT |
| 138 if mode: | 138 if mode: |
| 139 path = os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, arch)) | |
| 140 # TODO(ngeoffray): Remove this test once the testing infrastructure does not | 139 # TODO(ngeoffray): Remove this test once the testing infrastructure does not |
| 141 # treat 'dartc' as an arch. | 140 # treat 'dartc' as an arch. |
| 142 if not os.path.exists(path) and arch == 'dartc': | 141 if arch == 'dartc': arch = ARCH_GUESS |
| 143 path = os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, ARCH_GUESS)) | 142 return os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, arch)) |
| 144 return path; | |
| 145 else: | 143 else: |
| 146 return BUILD_ROOT[target_os] | 144 return BUILD_ROOT[target_os] |
| 147 | 145 |
| 148 def GetBaseDir(): | 146 def GetBaseDir(): |
| 149 return BASE_DIR | 147 return BASE_DIR |
| 150 | 148 |
| 151 def RewritePathSeparator(path, workspace): | 149 def RewritePathSeparator(path, workspace): |
| 152 # Paths in test files are always specified using '/' | 150 # Paths in test files are always specified using '/' |
| 153 # as the path separator. Replace with the actual | 151 # as the path separator. Replace with the actual |
| 154 # path separator before use. | 152 # path separator before use. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 def __init__(self, value): | 245 def __init__(self, value): |
| 248 self.value = value | 246 self.value = value |
| 249 | 247 |
| 250 def __str__(self): | 248 def __str__(self): |
| 251 return repr(self.value) | 249 return repr(self.value) |
| 252 | 250 |
| 253 | 251 |
| 254 if __name__ == "__main__": | 252 if __name__ == "__main__": |
| 255 import sys | 253 import sys |
| 256 Main(sys.argv) | 254 Main(sys.argv) |
| OLD | NEW |