I'd like to use the Rhino JavaScript compiler to compile some JavaScript to .class bytecode files for use in a project. It seems like this should already exist, since there are groovyc, netrexxc, and jythonc tasks for Groovy, NetREXX(!) and Jython, respectively. Has anyone used or written such an Ant task, or can anyone provide some tips on how to write one?
Ideally it would have some way to resolve dependencies among JavaScript or Java classes.
Why not simply use java task?
<java fork="yes"
classpathref="build.path"
classname="org.mozilla.javascript.tools.jsc.Main"
failonerror="true">
<arg value="-debug"/>
...
<arg value="file.js"/>
</java>
Any objections?