Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2011 Google Inc. All Rights Reserved. | |
| 2 | |
| 3 import os | |
| 4 import platform | |
| 5 import shutil | |
| 6 import stat | |
| 7 import sys | |
| 8 | |
| 9 HOME = os.path.dirname(os.path.realpath(__file__)) | |
| 10 HOME = os.path.join(HOME, os.pardir, os.pardir) | |
| 11 | |
| 12 sys.path.append(HOME) | |
| 13 import frog | |
| 14 | |
| 15 # Runs frog.dart on the dart vm to compile frogpad.dart to frogpad.js | |
| 16 def main(args): | |
| 17 if len(args) >= 2: | |
| 18 product_dir = args[1] | |
| 19 else: | |
| 20 product_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), | |
| 21 '..', '..', '..', 'out/Release_ia32')) | |
| 22 print product_dir | |
| 23 | |
| 24 vm = os.path.join(product_dir, 'dart') | |
| 25 frogpad_dart = os.path.join(product_dir, '..', '..', | |
| 26 'tools', 'testing', 'frogpad', 'frogpad.dart') | |
| 27 frogpad_js = os.path.join(product_dir, 'frog', 'bin', 'frogpad.js') | |
| 28 | |
| 29 if not os.path.exists(vm): | |
| 30 raise Exception("cannot find dart vm '%s'" % vm) | |
| 31 | |
| 32 args = ['frog.py', | |
| 33 '--verbose', | |
| 34 '--vm=' + vm, | |
| 35 '--', | |
| 36 '--out=' + frogpad_js, | |
| 37 frogpad_dart] | |
| 38 | |
| 39 exit_code = frog.main(args) | |
| 40 if exit_code: | |
| 41 return exit_code | |
| 42 | |
| 43 if not os.path.exists(frogpad_js): | |
| 44 raise Exception("didn't generate '%s'" % frogpad_js) | |
| 45 | |
| 46 os.chmod(frogpad_js, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | | |
|
Siggi Cherem (dart-lang)
2012/03/06 17:59:50
I thought from the other CL that you didn't need a
mattsh
2012/03/06 18:06:46
Ah good point. Now removed.
| |
| 47 stat.S_IRGRP | stat.S_IWUSR) | |
| 48 return 0 | |
| 49 | |
| 50 | |
| 51 if __name__ == '__main__': | |
| 52 sys.exit(main(sys.argv)) | |
| OLD | NEW |