| OLD | NEW |
| 1 # Copyright 2011 Google Inc. All Rights Reserved. | 1 # Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | 2 |
| 3 import os | 3 import os |
| 4 import platform | 4 import platform |
| 5 import shutil | 5 import shutil |
| 6 import stat | 6 import stat |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 HOME = os.path.dirname(os.path.realpath(__file__)) | 9 HOME = os.path.dirname(os.path.realpath(__file__)) |
| 10 HOME = os.path.join(HOME, os.pardir, os.pardir) | 10 HOME = os.path.join(HOME, os.pardir, os.pardir) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 def main(args): | 25 def main(args): |
| 26 product_dir = args[1] | 26 product_dir = args[1] |
| 27 js_out = os.path.join(product_dir, 'frog', 'bin', 'frogsh') | 27 js_out = os.path.join(product_dir, 'frog', 'bin', 'frogsh') |
| 28 vm = os.path.join(product_dir, 'dart') | 28 vm = os.path.join(product_dir, 'dart') |
| 29 id = platform.system() | 29 id = platform.system() |
| 30 if id == 'Windows' or id == 'Microsoft': | 30 if id == 'Windows' or id == 'Microsoft': |
| 31 vm = vm + '.exe' | 31 vm = vm + '.exe' |
| 32 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frogsh.bat'), | 32 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frogsh.bat'), |
| 33 js_out + '.bat') | 33 js_out + '.bat') |
| 34 frog_args = ['frog.py', '--vm=' + vm, '--', '--out=' + js_out, 'minfrog.dart'] | 34 frog_args = ['frog.py', '--vm=' + vm, |
| 35 '--js_cmd=node --crankshaft', |
| 36 '--', |
| 37 '--out=' + js_out, 'minfrog.dart'] |
| 35 | 38 |
| 36 # TODO(ngeoffray): Compile frogsh without checks integrated. | 39 # TODO(ngeoffray): Compile frogsh without checks integrated. |
| 37 # if js_out.find('Release') != -1: | 40 # if js_out.find('Release') != -1: |
| 38 exit_code = frog.main(frog_args) | 41 exit_code = frog.main(frog_args) |
| 39 if exit_code: | 42 if exit_code: |
| 40 if js_out.find('Release') != -1: | 43 if js_out.find('Release') != -1: |
| 41 return exit_code | 44 return exit_code |
| 42 else: | 45 else: |
| 43 with open(js_out, 'w') as f: | 46 with open(js_out, 'w') as f: |
| 44 f.write(FROGSH_FALLBACK) | 47 f.write(FROGSH_FALLBACK) |
| 45 | 48 |
| 46 os.chmod(js_out, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | | 49 os.chmod(js_out, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | |
| 47 stat.S_IRGRP | stat.S_IWUSR) | 50 stat.S_IRGRP | stat.S_IWUSR) |
| 48 return 0 | 51 return 0 |
| 49 | 52 |
| 50 | 53 |
| 51 if __name__ == '__main__': | 54 if __name__ == '__main__': |
| 52 sys.exit(main(sys.argv)) | 55 sys.exit(main(sys.argv)) |
| OLD | NEW |