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

Side by Side Diff: frog/scripts/bootstrap/build_frogpad_js.py

Issue 9610002: remove node.js dependency by running the frog compiler in (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: no change Created 8 years, 9 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 | « frog/dart-frog.gyp ('k') | frog/scripts/bootstrap/frogsh_bootstrap_wrapper.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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)
11 11
12 sys.path.append(HOME) 12 sys.path.append(HOME)
13 import frog 13 import frog
14 14
15 # Runs frog.dart on the dart vm to compile frogpad.dart to frogpad.js 15 # Runs frog.dart on the dart vm to compile frogpad.dart to frogpad.js
16 def main(args): 16 def main(args):
17 if len(args) >= 2: 17 product_dir = args[1]
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 18
24 vm = os.path.join(product_dir, 'dart') 19 vm = os.path.join(product_dir, 'dart')
25 frogpad_dart = os.path.join(product_dir, '..', '..', 20 frogpad_dart = os.path.join(product_dir, '..', '..',
26 'tools', 'testing', 'frogpad', 'frogpad.dart') 21 'tools', 'testing', 'frogpad', 'frogpad.dart')
27 frogpad_js = os.path.join(product_dir, 'frog', 'bin', 'frogpad.js') 22 frogpad_js = os.path.join(product_dir, 'frog', 'bin', 'frogpad.js')
28 23
29 if not os.path.exists(vm): 24 if not os.path.exists(vm):
30 raise Exception("cannot find dart vm '%s'" % vm) 25 raise Exception("cannot find dart vm '%s'" % vm)
31 26
32 args = ['frog.py', 27 args = ['frog.py',
33 '--verbose', 28 '--verbose',
34 '--vm=' + vm, 29 '--vm=' + vm,
35 '--', 30 '--',
36 '--out=' + frogpad_js, 31 '--out=' + frogpad_js,
37 frogpad_dart] 32 frogpad_dart]
38 33
39 exit_code = frog.main(args) 34 exit_code = frog.main(args)
40 if exit_code: 35 if exit_code:
41 return exit_code 36 return exit_code
42 37
43 if not os.path.exists(frogpad_js): 38 if not os.path.exists(frogpad_js):
44 raise Exception("didn't generate '%s'" % frogpad_js) 39 raise Exception("didn't generate '%s'" % frogpad_js)
45 40
46 return 0 41 return 0
47 42
48 43
49 if __name__ == '__main__': 44 if __name__ == '__main__':
50 sys.exit(main(sys.argv)) 45 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « frog/dart-frog.gyp ('k') | frog/scripts/bootstrap/frogsh_bootstrap_wrapper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698