| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 'freebsd': os.path.join('out'), | 123 'freebsd': os.path.join('out'), |
| 124 'macos': os.path.join('xcodebuild'), | 124 'macos': os.path.join('xcodebuild'), |
| 125 } | 125 } |
| 126 | 126 |
| 127 def GetBuildMode(mode): | 127 def GetBuildMode(mode): |
| 128 global BUILD_MODES | 128 global BUILD_MODES |
| 129 return BUILD_MODES[mode] | 129 return BUILD_MODES[mode] |
| 130 | 130 |
| 131 | 131 |
| 132 def GetBuildConf(mode, arch): | 132 def GetBuildConf(mode, arch): |
| 133 return GetBuildMode(mode) + "_" + arch | 133 return '%s%s' % (GetBuildMode(mode), arch.upper()) |
| 134 | 134 |
| 135 ARCH_GUESS = GuessArchitecture() | 135 ARCH_GUESS = GuessArchitecture() |
| 136 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..')) | 136 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..')) |
| 137 | 137 |
| 138 def GetBuildRoot(target_os, mode=None, arch=None): | 138 def GetBuildRoot(target_os, mode=None, arch=None): |
| 139 global BUILD_ROOT | 139 global BUILD_ROOT |
| 140 if mode: | 140 if mode: |
| 141 return os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, arch)) | 141 return os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, arch)) |
| 142 else: | 142 else: |
| 143 return BUILD_ROOT[target_os] | 143 return BUILD_ROOT[target_os] |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 | 272 |
| 273 def Touch(name): | 273 def Touch(name): |
| 274 with file(name, 'a'): | 274 with file(name, 'a'): |
| 275 os.utime(name, None) | 275 os.utime(name, None) |
| 276 | 276 |
| 277 | 277 |
| 278 if __name__ == "__main__": | 278 if __name__ == "__main__": |
| 279 import sys | 279 import sys |
| 280 Main(sys.argv) | 280 Main(sys.argv) |
| OLD | NEW |