using recent Rhino in ant script

元气小坏坏 提交于 2019-12-06 01:49:39

I've got it working using the following Ant project:

<project default="hello" name="helloworld" basedir=".">
   <target name="hello">
       <script language="javascript" manager="bsf">
       <classpath>
           <fileset dir="rhino-lib" includes="*.jar"></fileset>
       </classpath><![CDATA[
           x=<hello><world/></hello>
        echo = helloworld.createTask("echo");
        for (i=1; i<=10; i++) {

          echo.setMessage(i*i);
          echo.perform();
        }
        echo.setMessage(x);
        echo.perform();

       ]]></script>     
   </target>
</project>

You need the following jars in ./rhino-lib:

Not the prettiest, but it works. I will try a bit more to see if I can get it to work with javax.script.

See the following response on the Ant user's mailing list: http://mail-archives.apache.org/mod_mbox/ant-user/201008.mbox/browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!