| Index: third_party/closure_compiler/compile.py
|
| diff --git a/third_party/closure_compiler/compile.py b/third_party/closure_compiler/compile.py
|
| index c9dcc50b352894d879dee247f2529b6a20f59866..99d0d103d4d8ba7a3f2d5a9609a5b5629e61f8d0 100755
|
| --- a/third_party/closure_compiler/compile.py
|
| +++ b/third_party/closure_compiler/compile.py
|
| @@ -40,7 +40,7 @@ class Checker(object):
|
| Args:
|
| verbose: Whether this class should output diagnostic messages.
|
| """
|
| - self._runner_jar = os.path.join(_CURRENT_DIR, "runner", "runner.jar")
|
| + self._compiler_jar = os.path.join(_CURRENT_DIR, "compiler", "compiler.jar")
|
| self._temp_files = []
|
| self._verbose = verbose
|
| self._error_filter = error_filter.PromiseErrorFilter()
|
| @@ -184,14 +184,13 @@ class Checker(object):
|
| return tmp_file.name
|
|
|
| def _run_js_check(self, sources, out_file=None, externs=None,
|
| - runner_args=None, closure_args=None):
|
| + closure_args=None):
|
| """Check |sources| for type errors.
|
|
|
| Args:
|
| sources: Files to check.
|
| out_file: A file where the compiled output is written to.
|
| externs: @extern files that inform the compiler about custom globals.
|
| - runner_args: Arguments passed to runner.jar.
|
| closure_args: Arguments passed directly to the Closure compiler.
|
|
|
| Returns:
|
| @@ -210,18 +209,12 @@ class Checker(object):
|
| args += ["--externs=%s" % e for e in externs or []]
|
|
|
| closure_args = closure_args or []
|
| - closure_args += ["summary_detail_level=3"]
|
| + closure_args += ["summary_detail_level=3", "continue_after_errors"]
|
| args += ["--%s" % arg for arg in closure_args]
|
|
|
| - args_file_content = " %s" % " ".join(args)
|
| - self._log_debug("Args: %s" % args_file_content.strip())
|
| + self._log_debug("Args: %s" % " ".join(args))
|
|
|
| - args_file = self._create_temp_file(args_file_content)
|
| - self._log_debug("Args file: %s" % args_file)
|
| -
|
| - processed_runner_args = ["--%s" % arg for arg in runner_args or []]
|
| - processed_runner_args += ["--compiler-args-file=%s" % args_file]
|
| - _, stderr = self._run_jar(self._runner_jar, processed_runner_args)
|
| + _, stderr = self._run_jar(self._compiler_jar, args)
|
|
|
| errors = stderr.strip().split("\n\n")
|
| maybe_summary = errors.pop()
|
| @@ -243,7 +236,7 @@ class Checker(object):
|
| return errors, stderr
|
|
|
| def check(self, source_file, out_file=None, depends=None, externs=None,
|
| - runner_args=None, closure_args=None):
|
| + closure_args=None):
|
| """Closure compiler |source_file| while checking for errors.
|
|
|
| Args:
|
| @@ -251,7 +244,6 @@ class Checker(object):
|
| out_file: A file where the compiled output is written to.
|
| depends: Files that |source_file| requires to run (e.g. earlier <script>).
|
| externs: @extern files that inform the compiler about custom globals.
|
| - runner_args: Arguments passed to runner.jar.
|
| closure_args: Arguments passed directly to the Closure compiler.
|
|
|
| Returns:
|
| @@ -281,7 +273,6 @@ class Checker(object):
|
|
|
| errors, stderr = self._run_js_check([self._expanded_file],
|
| out_file=out_file, externs=externs,
|
| - runner_args=runner_args,
|
| closure_args=closure_args)
|
| filtered_errors = self._filter_errors(errors)
|
| cleaned_errors = map(self._clean_up_error, filtered_errors)
|
| @@ -297,14 +288,13 @@ class Checker(object):
|
| return bool(cleaned_errors), stderr
|
|
|
| def check_multiple(self, sources, out_file=None, externs=None,
|
| - runner_args=None, closure_args=None):
|
| + closure_args=None):
|
| """Closure compile a set of files and check for errors.
|
|
|
| Args:
|
| sources: An array of files to check.
|
| out_file: A file where the compiled output is written to.
|
| externs: @extern files that inform the compiler about custom globals.
|
| - runner_args: Arguments passed to runner.jar.
|
| closure_args: Arguments passed directly to the Closure compiler.
|
|
|
| Returns:
|
| @@ -313,7 +303,6 @@ class Checker(object):
|
| """
|
| errors, stderr = self._run_js_check(sources, out_file=out_file,
|
| externs=externs,
|
| - runner_args=runner_args,
|
| closure_args=closure_args)
|
| self._nuke_temp_files()
|
| return bool(errors), stderr
|
| @@ -336,8 +325,6 @@ if __name__ == "__main__":
|
| parser.add_argument("-e", "--externs", nargs=argparse.ZERO_OR_MORE)
|
| parser.add_argument("-o", "--out_file",
|
| help="A file where the compiled output is written to")
|
| - parser.add_argument("-r", "--runner_args", nargs=argparse.ZERO_OR_MORE,
|
| - help="Arguments passed to runner.jar")
|
| parser.add_argument("-c", "--closure_args", nargs=argparse.ZERO_OR_MORE,
|
| help="Arguments passed directly to the Closure compiler")
|
| parser.add_argument("-v", "--verbose", action="store_true",
|
| @@ -364,7 +351,6 @@ if __name__ == "__main__":
|
|
|
| found_errors, _ = checker.check(source, out_file=opts.out_file,
|
| depends=depends, externs=externs,
|
| - runner_args=opts.runner_args,
|
| closure_args=opts.closure_args)
|
| if found_errors:
|
| sys.exit(1)
|
| @@ -373,7 +359,6 @@ if __name__ == "__main__":
|
| sources,
|
| out_file=opts.out_file,
|
| externs=externs,
|
| - runner_args=opts.runner_args,
|
| closure_args=opts.closure_args)
|
| if found_errors:
|
| print stderr
|
|
|