OLD | NEW |
| (Empty) |
1 # Copyright 2012 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.dirname(os.path.dirname( | |
10 os.path.realpath(__file__)))) | |
11 BUILDER_NAME = os.environ.get('BUILDBOT_BUILDERNAME') | |
12 | |
13 END_SCRIPT = ''' | |
14 VM = r'%s' | |
15 D8 = r'%s' | |
16 HOME = r'%s' | |
17 if __name__ == '__main__': | |
18 sys.exit(main(sys.argv)) | |
19 ''' | |
20 | |
21 def main(args): | |
22 product_dir = args[1] | |
23 vm = os.path.join(product_dir, 'dart') | |
24 d8 = os.path.join(product_dir, 'd8') | |
25 id = platform.system() | |
26 if id == 'Windows' or id == 'Microsoft': | |
27 vm = vm + '.exe' | |
28 frog = os.path.join(product_dir, 'frog', 'bin', 'frog') | |
29 | |
30 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog_wrapper.py'), | |
31 frog) | |
32 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog.bat'), | |
33 frog + '.bat') | |
34 | |
35 with open(frog, 'a+') as f: | |
36 f.write(END_SCRIPT % (vm, d8, HOME)) | |
37 | |
38 os.chmod(frog, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | | |
39 stat.S_IRGRP | stat.S_IWUSR) | |
40 return 0 | |
41 | |
42 | |
43 if __name__ == '__main__': | |
44 sys.exit(main(sys.argv)) | |
OLD | NEW |