* use non-jdk rhino in ExpressionFormat
* add rhino to lib and include it in builds
This commit is contained in:
parent
cc6b4959e7
commit
82bd7fa3b1
34
build.xml
34
build.xml
|
@ -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 -->
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -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 {
|
||||
|
|
|
@ -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")));
|
||||
|
||||
|
|
Loading…
Reference in New Issue