ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Donaldson" <paul.donald...@seewhy.com>
Subject Script task not found
Date Mon, 24 Apr 2006 15:15:42 GMT
Hello,

I need to perform some simple arithmetic on the contents of a string. I have
read that the Script task is suitable for this purpose.

I define my task as:
<taskdef name="script"
classname="org.apache.tools.ant.taskdefs.optional.Script">

But I keep getting the message:
file:build.xml:5: taskdef class
org.apache.tools.ant.taskdefs.optional.Script cannot be found

I can see the class in optional.jar. optional.jar is in my ant lib folder. I
have tried adding a classpath attribute to the taskdef and setting it to the
ant lib folder, but with the same result. 

Does anyone know the reason for this?

Not that it gets this far, but the target that uses the script task is
defined as:

  <target name="setup">

    <script language="javascript"> <![CDATA[

      for (i=1; i<=10; i++) {
        echo = squares.createTask("echo");
        main.addTask(echo);
        echo.setMessage(i*i);
      }

    ]]> </script>

  </target>

I am using Ant version 1.5.1
I have downloaded and installed to ANT_HOME/lib:
js.jar version 1.6 R2 from www.mozilla.org/rhino/
bsf.jar 2.3.0 from jakart.apache.org/bsf/

Many thanks,
Paul



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message