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

Unified Diff: frog/scripts/bootstrap/build_frogpad_js.py

Issue 9546015: create build_frogpad_js.py to help repro bug 1700 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: removed chmod 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/testing/frogpad/frogpad.dart » ('j') | tools/testing/frogpad/frogpad.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/scripts/bootstrap/build_frogpad_js.py
diff --git a/frog/scripts/bootstrap/build_frogpad_js.py b/frog/scripts/bootstrap/build_frogpad_js.py
new file mode 100644
index 0000000000000000000000000000000000000000..c4e09586408c043440150eb4d6751c9b876849dc
--- /dev/null
+++ b/frog/scripts/bootstrap/build_frogpad_js.py
@@ -0,0 +1,50 @@
+# Copyright 2011 Google Inc. All Rights Reserved.
ahe 2012/03/07 13:07:54 Why is this file in scripts/bootstrap? How is this
+
+import os
+import platform
+import shutil
+import stat
+import sys
+
+HOME = os.path.dirname(os.path.realpath(__file__))
+HOME = os.path.join(HOME, os.pardir, os.pardir)
+
+sys.path.append(HOME)
+import frog
+
+# Runs frog.dart on the dart vm to compile frogpad.dart to frogpad.js
+def main(args):
+ if len(args) >= 2:
+ product_dir = args[1]
+ else:
+ product_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
+ '..', '..', '..', 'out/Release_ia32'))
ngeoffray 2012/03/07 12:53:44 out/Release_ia32 is linux only. I think this scrip
+ print product_dir
+
+ vm = os.path.join(product_dir, 'dart')
+ frogpad_dart = os.path.join(product_dir, '..', '..',
+ 'tools', 'testing', 'frogpad', 'frogpad.dart')
+ frogpad_js = os.path.join(product_dir, 'frog', 'bin', 'frogpad.js')
+
+ if not os.path.exists(vm):
+ raise Exception("cannot find dart vm '%s'" % vm)
+
+ args = ['frog.py',
+ '--verbose',
+ '--vm=' + vm,
+ '--',
+ '--out=' + frogpad_js,
+ frogpad_dart]
+
+ exit_code = frog.main(args)
+ if exit_code:
+ return exit_code
+
+ if not os.path.exists(frogpad_js):
+ raise Exception("didn't generate '%s'" % frogpad_js)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
« no previous file with comments | « no previous file | tools/testing/frogpad/frogpad.dart » ('j') | tools/testing/frogpad/frogpad.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698