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

Unified Diff: frog/scripts/bootstrap/frogsh_bootstrap_wrapper.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: updated test_options Created 8 years, 10 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
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
index b74c0de722dc2282cd183bdc00fc2f7e81c67fbd..1040807937674f8ed5bc5399b38e4e1387d2ba1f 100644
--- a/frog/scripts/bootstrap/frogsh_bootstrap_wrapper.py
+++ b/frog/scripts/bootstrap/frogsh_bootstrap_wrapper.py
@@ -9,44 +9,34 @@ 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
+# Runs frog.dart on the dart vm to compile frogpad.dart to frogpad.js
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'),
Emily Fortuna 2012/03/06 00:37:52 We don't have a DRT replacement for Windows yet, s
- 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)
+ 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',
+ '--vm=' + vm,
+ '--',
+ '--out=' + frogpad_js,
+ frogpad_dart]
+
+ exit_code = frog.main(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)
+ return exit_code
+
+ if not os.path.exists(frogpad_js):
+ raise Exception("didn't generate '%s'" % frogpad_js)
- os.chmod(js_out, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR |
+ os.chmod(frogpad_js, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR |
stat.S_IRGRP | stat.S_IWUSR)
return 0

Powered by Google App Engine
This is Rietveld 408576698