Which version of ant are you using ?
optional.jar existed in ant up to ant 1.5.x.
in ant 1.6.x, there is a file ant-apache-bsf.jar which contains the
implementation on the ant side of scripting tasks and functionality.
Also you normally do not need to taskdef script in ant 1.6.x and ant
1.5.x, it should be in the list of default tasks (Zip entry
org.apache.tools.ant.taskdefs.default.properties in ant.jar)
Regards,
Antoine
Paul Donaldson wrote:
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]