Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: tools/utils.py

Issue 23572028: Added support for using a checked-in binary of dart for ARM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/testing/bin/linux/dart-arm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 with file(name, 'a'): 430 with file(name, 'a'):
431 os.utime(name, None) 431 os.utime(name, None)
432 432
433 433
434 def DartBinary(): 434 def DartBinary():
435 tools_dir = os.path.dirname(os.path.realpath(__file__)) 435 tools_dir = os.path.dirname(os.path.realpath(__file__))
436 dart_binary_prefix = os.path.join(tools_dir, 'testing', 'bin') 436 dart_binary_prefix = os.path.join(tools_dir, 'testing', 'bin')
437 if IsWindows(): 437 if IsWindows():
438 return os.path.join(dart_binary_prefix, 'windows', 'dart.exe') 438 return os.path.join(dart_binary_prefix, 'windows', 'dart.exe')
439 else: 439 else:
440 return os.path.join(dart_binary_prefix, GuessOS(), 'dart') 440 arch = GuessArchitecture()
441 system = GuessOS()
442 if arch == 'arm':
443 return os.path.join(dart_binary_prefix, system, 'dart-arm')
444 else:
445 return os.path.join(dart_binary_prefix, system, 'dart')
441 446
442 447
443 def DartSdkBinary(): 448 def DartSdkBinary():
444 tools_dir = os.path.dirname(os.path.realpath(__file__)) 449 tools_dir = os.path.dirname(os.path.realpath(__file__))
445 dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin') 450 dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin')
446 return os.path.join(dart_binary_prefix, 'dart') 451 return os.path.join(dart_binary_prefix, 'dart')
447 452
448 class TempDir(object): 453 class TempDir(object):
449 def __init__(self, prefix=''): 454 def __init__(self, prefix=''):
450 self._temp_dir = None 455 self._temp_dir = None
451 self._prefix = prefix 456 self._prefix = prefix
452 457
453 def __enter__(self): 458 def __enter__(self):
454 self._temp_dir = tempfile.mkdtemp(self._prefix) 459 self._temp_dir = tempfile.mkdtemp(self._prefix)
455 return self._temp_dir 460 return self._temp_dir
456 461
457 def __exit__(self, *_): 462 def __exit__(self, *_):
458 shutil.rmtree(self._temp_dir, ignore_errors=True) 463 shutil.rmtree(self._temp_dir, ignore_errors=True)
459 464
460 465
461 if __name__ == "__main__": 466 if __name__ == "__main__":
462 import sys 467 import sys
463 Main(sys.argv) 468 Main(sys.argv)
OLDNEW
« no previous file with comments | « tools/testing/bin/linux/dart-arm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698