Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2011 Google Inc. All Rights Reserved. | |
|
ahe
2012/03/07 13:07:54
Why is this file in scripts/bootstrap? How is this
| |
| 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')) | |
|
ngeoffray
2012/03/07 12:53:44
out/Release_ia32 is linux only. I think this scrip
| |
| 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 return 0 | |
| 47 | |
| 48 | |
| 49 if __name__ == '__main__': | |
| 50 sys.exit(main(sys.argv)) | |
| OLD | NEW |