| Index: tools/testing/frogpad/frogpad.py
|
| diff --git a/tools/testing/frogpad/frogpad.py b/tools/testing/frogpad/frogpad.py
|
| index c9f1f3a8a3fd208e20b14be2dce3e4b13cd1d3e4..33cce2e57072371e0eeaeede2f20da2e0a088838 100755
|
| --- a/tools/testing/frogpad/frogpad.py
|
| +++ b/tools/testing/frogpad/frogpad.py
|
| @@ -1,4 +1,4 @@
|
| -#!/usr/bin/python
|
| +#!/usr/bin/env python
|
|
|
| # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| # for details. All rights reserved. Use of this source code is governed by a
|
| @@ -130,6 +130,7 @@ DART_LIBRARIES = {
|
| "dom": "../client/dom/frog/dom_frog.dart",
|
| "html": "../client/html/release/html.dart",
|
| "htmlimpl": "../client/html/release/htmlimpl.dart",
|
| + "isolate": "../lib/isolate/isolate_frog.dart",
|
| "json": "../lib/json/json_frog.dart"
|
| }
|
|
|
| @@ -144,8 +145,8 @@ class Pad(object):
|
| parser = optparse.OptionParser(usage=
|
| "%prog [options] file_to_compile.dart"
|
| )
|
| - parser.add_option("-r", "--rebuild", action="store_true",
|
| - help="forces rebuild of the frogpad javascript")
|
| + parser.add_option("-f", "--frogpad_js",
|
| + help="location of frogpad.js file")
|
| parser.add_option("-o", "--out",
|
| help="name of javascript output file")
|
| parser.add_option("-v", "--verbose", action="store_true",
|
| @@ -177,8 +178,14 @@ class Pad(object):
|
| logging.debug("frog_dir: '%s'" % self.frog_dir)
|
| logging.debug("frogpad_dir: '%s'" % self.frogpad_dir)
|
|
|
| - # name of frogpad_js file
|
| - self.frogpad_js = os.path.join(self.frogpad_dir, FROGPAD_JS)
|
| + # location frogpad.js file
|
| + if not options.frogpad_js:
|
| + raise Exception("--frogpad_js is required")
|
| +
|
| + if not os.path.exists(options.frogpad_js):
|
| + raise FileNotFoundException(options.frogpad_js)
|
| +
|
| + self.frogpad_js = options.frogpad_js
|
|
|
| if options.out:
|
| # user has specified an output file
|
| @@ -201,12 +208,6 @@ class Pad(object):
|
| # map from script tag id to File object
|
| self.id_to_file = {}
|
|
|
| - if not os.path.exists(self.frogpad_js):
|
| - options.rebuild = True
|
| -
|
| - if options.rebuild:
|
| - self.build_frogpad_js()
|
| -
|
| self.load_libraries()
|
| self.load_file(self.main_file)
|
|
|
| @@ -219,42 +220,6 @@ class Pad(object):
|
| line_count = len(js.splitlines())
|
| logging.info("generated '%s' (%d lines)", self.js_file, line_count)
|
|
|
| - def build_frogpad_js(self):
|
| - dart_vm = os.path.join(self.dart_dir, "out/Release_ia32/dart")
|
| - check_exists(dart_vm)
|
| -
|
| - frogc_dart = os.path.join(self.frog_dir, "frogc.dart")
|
| - frogpad_dart = os.path.join(self.frogpad_dir, "frogpad.dart")
|
| - check_exists(frogc_dart)
|
| - check_exists(frogpad_dart)
|
| -
|
| - args = []
|
| - args.append(dart_vm)
|
| -
|
| - # command line arguments for the dart vm
|
| -
|
| - # We leave out --enable_type_checks here for speed.
|
| - # args.append("--enable_type_checks")
|
| -
|
| - args.append("--enable_asserts")
|
| -
|
| - # The dart program we're going to run on the dart vm.
|
| - args.append(frogc_dart)
|
| -
|
| - # Command line arguments for frogc.dart
|
| - args.append("--libdir=%s/lib" % self.frog_dir)
|
| - args.append("--compile-only")
|
| - args.append("--enable_type_checks")
|
| - args.append("--enable_asserts")
|
| - args.append("--out=%s" % self.frogpad_js)
|
| -
|
| - # The dart program that we want frogc.dart to compile.
|
| - args.append(frogpad_dart)
|
| - logging.info("generating '%s'" % self.frogpad_js)
|
| -
|
| - run_command(args)
|
| - check_exists(self.frogpad_js)
|
| -
|
| def generate_html(self):
|
| tags = []
|
| for f in self.id_to_file.values():
|
|
|