| 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 platform | 8 import platform |
| 9 import re | 9 import re |
| 10 import os | 10 import os |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 'freebsd': os.path.join('out'), | 118 'freebsd': os.path.join('out'), |
| 119 'macos': os.path.join('xcodebuild'), | 119 'macos': os.path.join('xcodebuild'), |
| 120 } | 120 } |
| 121 | 121 |
| 122 def GetBuildMode(mode): | 122 def GetBuildMode(mode): |
| 123 global BUILD_MODES | 123 global BUILD_MODES |
| 124 return BUILD_MODES[mode] | 124 return BUILD_MODES[mode] |
| 125 | 125 |
| 126 | 126 |
| 127 def GetBuildConf(mode, arch): | 127 def GetBuildConf(mode, arch): |
| 128 return GetBuildMode(mode) + "_" + arch | 128 return GetBuildMode(mode) + arch.upper() |
| 129 | 129 |
| 130 | 130 |
| 131 def GetBuildRoot(target_os, mode=None, arch=None): | 131 def GetBuildRoot(target_os, mode=None, arch=None): |
| 132 global BUILD_ROOT | 132 global BUILD_ROOT |
| 133 if mode: | 133 if mode: |
| 134 return os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, arch)) | 134 return os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, arch)) |
| 135 else: | 135 else: |
| 136 return BUILD_ROOT[target_os] | 136 return BUILD_ROOT[target_os] |
| 137 | 137 |
| 138 | 138 |
| 139 def Main(argv): | 139 def Main(argv): |
| 140 print "GuessOS() -> ", GuessOS() | 140 print "GuessOS() -> ", GuessOS() |
| 141 print "GuessArchitecture() -> ", GuessArchitecture() | 141 print "GuessArchitecture() -> ", GuessArchitecture() |
| 142 print "GuessCpus() -> ", GuessCpus() | 142 print "GuessCpus() -> ", GuessCpus() |
| 143 print "IsWindows() -> ", IsWindows() | 143 print "IsWindows() -> ", IsWindows() |
| 144 | 144 |
| 145 | 145 |
| 146 if __name__ == "__main__": | 146 if __name__ == "__main__": |
| 147 import sys | 147 import sys |
| 148 Main(sys.argv) | 148 Main(sys.argv) |
| OLD | NEW |