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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 '%s%s' % (GetBuildMode(mode), arch.upper()) | 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(host_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[host_os], GetBuildConf(mode, arch)) |
142 else: | 142 else: |
143 return BUILD_ROOT[target_os] | 143 return BUILD_ROOT[host_os] |
144 | 144 |
145 def GetBaseDir(): | 145 def GetBaseDir(): |
146 return BASE_DIR | 146 return BASE_DIR |
147 | 147 |
148 def GetSVNRevision(): | 148 def GetSVNRevision(): |
149 p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE, | 149 p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE, |
150 stderr = subprocess.STDOUT, shell=IsWindows()) | 150 stderr = subprocess.STDOUT, shell=IsWindows()) |
151 output, not_used = p.communicate() | 151 output, not_used = p.communicate() |
152 revision = ParseSvnInfoOutput(output) | 152 revision = ParseSvnInfoOutput(output) |
153 if revision: | 153 if revision: |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 | 287 |
288 def Touch(name): | 288 def Touch(name): |
289 with file(name, 'a'): | 289 with file(name, 'a'): |
290 os.utime(name, None) | 290 os.utime(name, None) |
291 | 291 |
292 | 292 |
293 if __name__ == "__main__": | 293 if __name__ == "__main__": |
294 import sys | 294 import sys |
295 Main(sys.argv) | 295 Main(sys.argv) |
OLD | NEW |