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

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

Issue 9669019: Revert "Revert the revert." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « frog/dart-frog.gyp ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/scripts/bootstrap/frogsh_bootstrap_wrapper.py
diff --git a/frog/scripts/bootstrap/frogsh_bootstrap_wrapper.py b/frog/scripts/bootstrap/frogsh_bootstrap_wrapper.py
new file mode 100644
index 0000000000000000000000000000000000000000..b74c0de722dc2282cd183bdc00fc2f7e81c67fbd
--- /dev/null
+++ b/frog/scripts/bootstrap/frogsh_bootstrap_wrapper.py
@@ -0,0 +1,55 @@
+# Copyright 2011 Google Inc. All Rights Reserved.
+
+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)
+
+FROGSH_FALLBACK = """#!/bin/sh
+echo -en "\033[31mERROR\033[0m: Building frogsh in 'debug' mode requires "
+echo "building the dart"
+echo "runtime in 'release' mode. Retry building frogsh as follows:"
+echo " > rm $0"
+echo " > ./tools/build.py -m release runtime"
+echo " > ./tools/build.py -m debug frogsh"
+exit 1
+"""
+
+sys.path.append(HOME)
+import frog
+
+def main(args):
+ product_dir = args[1]
+ js_out = os.path.join(product_dir, 'frog', 'bin', 'frogsh')
+ vm = os.path.join(product_dir, 'dart')
+ id = platform.system()
+ if id == 'Windows' or id == 'Microsoft':
+ vm = vm + '.exe'
+ shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frogsh.bat'),
+ js_out + '.bat')
+ frog_args = ['frog.py', '--vm=' + vm,
+ '--js_cmd=node --crankshaft',
+ '--',
+ '--out=' + js_out, 'minfrog.dart']
+
+ # TODO(ngeoffray): Compile frogsh without checks integrated.
+ # if js_out.find('Release') != -1:
+ exit_code = frog.main(frog_args)
+ if exit_code:
+ if js_out.find('Release') != -1:
+ return exit_code
+ else:
+ with open(js_out, 'w') as f:
+ f.write(FROGSH_FALLBACK)
+
+ os.chmod(js_out, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR |
+ stat.S_IRGRP | stat.S_IWUSR)
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
« no previous file with comments | « frog/dart-frog.gyp ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698