Skip to content

nanaze/jscomprun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JsCompRun

This is a tool that uses JSCompiler/Closure Compiler's dependency resolution logic to take Closure-style sources, give them in dependency order (per specified on entry points), and run them on Rhino.

Why?

Because then you can run unit tests without the browser extremely quickly. Particularly useful to be able to run a big suite while you're developing as a smoke test before you run on heavyweight browser images.

Status

The scripts load, order, and run on Rhino.

Some changes to Closure's test runner are necessary to run correctly in Rhino. Those changes are in progress. Also, any code that makes assumptions about the environment that are not present in Rhino (the DOM is present, in the global scope, for example) will fail.

I am making prototype changes to closure in this fork: https://github.com/nanaze/closure-rhino-fork

Usage:

java -jar path/to/jscomprun-dev-jar-with-dependencies.jar --entry_point foo.bar.providedEntryPoint script1.js script2.js ...

You can also just specify the directories where your sources lives and JsCompRun will just pull all .js files. You should include the Closure sources.

java -jar path/to/jscomprun-dev-jar-with-dependencies.jar \
  -R path/to/closure-library \
  -R path/to/my-codebase \
  -e mycodebase.providedEntryPoint

An entry point is a symbol that has been "provided" with goog.provide().

Building

To build the standalone jar, run this from the root directory.

mvn clean compile assembly:single

You'll need Maven, obviously.

About

Run Closure-style code on Rhino

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages