Many members of this group have asked for an open-source version of
the Closure Compiler Service (
http://closure-compiler.appspot.com/
home), so I think the new solution that I have built (plovr) may be of
use to you, so please take a look:
http://code.google.com/p/plovr/wiki/GettingStarted
Instead of downloading the Closure Compiler, Closure Library, and
Closure Templates individually, plovr puts them all together so that
you can just point it at a directory full of your own JS and Soy
files, and plovr will compile them for you. Because plovr runs an HTTP
server, you just change the script tags in the development version of
your web application to point to localhost:9810 (where plovr is
running) to get the compiled version of your code. plovr will re-
compile each time the URL is reloaded, so there is no need to restart
plovr after editing a JS or Soy file.
A short JSON configuration file replaces the arguments that you
previously passed to calcdeps.py. Each config file must contain an id,
which is passed as a query parameter to the HTTP server (plovr can be
started with multiple config files, each with its own id). Therefore,
a script tag using plovr will look something like this:
<script src="
http://localhost:9810/config?id=configuration-
id&level=ADVANCED_OPTIMIZATIONS"></script>
Note how the compilation level can also be specified as a query
parameter. (Support for more compiler options via query parameters and/
or the config file is on the Roadmap:
http://code.google.com/p/plovr/wiki/Roadmap.)
The project is brand spanking new, so it is not as fully featured as I
would like yet, but I am very interested in feedback from this group
to help decide how to prioritize new features. If nothing else, I
believe this should be faster and simpler than the existing process
where you have to (1) translate Soy files to JS files, (2) parse the
dependencies of soyutils_usegoog.js, all Closure Library files, as
well as your own code, and then (3) run the Compiler. Because the
Closure Library files are read out of the jar, they are immutable, so
their dependencies are only parsed once. Also, because this runs as an
HTTP server, it eliminates the time spent spinning up a new JVM that
calcdeps.py requires.
Cheers,
Michael