* use non-jdk rhino in ExpressionFormat

* add rhino to lib and include it in builds
This commit is contained in:
Reinhard Pointner 2009-04-11 23:27:10 +00:00
parent cc6b4959e7
commit 82bd7fa3b1
5 changed files with 27 additions and 25 deletions

View File

@ -53,46 +53,50 @@
<!-- include libs -->
<zipfileset src="${dir.lib}/xercesImpl.jar">
<include name="**/*.class" />
<include name="**/*.properties" />
<include name="org/apache/**" />
<include name="org/w3c/dom/html/**" />
</zipfileset>
<zipfileset src="${dir.lib}/nekohtml.jar">
<include name="**/*.class" />
<include name="**/*.properties" />
<include name="org/cyberneko/html/**" />
</zipfileset>
<zipfileset src="${dir.lib}/simmetrics.jar">
<include name="**/*.class" />
<include name="uk/ac/shef/wit/simmetrics/**" />
</zipfileset>
<zipfileset src="${dir.lib}/glazedlists.jar">
<include name="**/*.class" />
<include name="ca/odell/glazedlists/**" />
</zipfileset>
<zipfileset src="${dir.lib}/miglayout.jar">
<include name="**/*.class" />
<include name="**/*.properties" />
<include name="net/miginfocom/**" />
</zipfileset>
<zipfileset src="${dir.lib}/xmlrpc-client.jar">
<include name="**/*.class" />
<include name="**/*.properties" />
<include name="redstone/xmlrpc/**" />
</zipfileset>
<zipfileset src="${dir.lib}/args4j.jar">
<include name="**/*.class" />
<include name="**/*.properties" />
<include name="org/kohsuke/args4j/**" />
</zipfileset>
<zipfileset src="${dir.lib}/ehcache.jar">
<include name="**/*.class" />
<include name="net/sf/ehcache/**" />
</zipfileset>
<zipfileset src="${dir.lib}/jna.jar">
<!-- include classes and native libraries -->
<include name="com/sun/jna/**" />
</zipfileset>
<zipfileset src="${dir.lib}/js-engine.jar">
<include name="com/sun/phobos/script/**" />
</zipfileset>
<zipfileset src="${dir.lib}/js.jar">
<include name="org/mozilla/**" />
</zipfileset>
</jar>
</target>
@ -106,10 +110,6 @@
<classpath>
<fileset dir="${dir.lib}" includes="*.jar" />
</classpath>
<bootclasspath>
<!-- specify bootclasspath explicitly so we can compile code that depends on sun.* classes -->
<fileset dir="${java.home}/lib" includes="*.jar" />
</bootclasspath>
</javac>
<!-- copy resources -->

BIN
lib/js-engine.jar Normal file

Binary file not shown.

BIN
lib/js.jar Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@ import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;
import sun.org.mozilla.javascript.internal.Scriptable;
import org.mozilla.javascript.Scriptable;
class AssociativeScriptObject implements Scriptable {

View File

@ -16,10 +16,11 @@ import javax.script.Compilable;
import javax.script.CompiledScript;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.script.SimpleScriptContext;
import com.sun.phobos.script.javascript.RhinoScriptEngine;
public class ExpressionFormat extends Format {
@ -37,7 +38,8 @@ public class ExpressionFormat extends Format {
protected ScriptEngine initScriptEngine() throws ScriptException {
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
// don't use jdk rhino so we can use rhino specific features and classes (e.g. Scriptable)
ScriptEngine engine = new RhinoScriptEngine();
engine.eval(new InputStreamReader(ExpressionFormat.class.getResourceAsStream("ExpressionFormat.global.js")));