Hello,
 
For some reason, I am having trouble using the script task.  I am using Ant 1.2.
I apparently do have the correct defaults.properties file, which references the
script task as being in the optional.jar, and the optional.jar I have does include
Script.class, and optional.jar is in my classpath, since I am able to run
other tasks contained in it, such as ejbjar.....
 
Any ideas?
 
I am using JDK 1.3.   It happens both on Windows NT 4.0 and on Solaris 7.
 
Below is the script file I am trying to run, taken
from one of the examples in the online doc for the script task:
 
*********************************************************
 
<project name="squares" default="main" basedir=".">
 
  <target name="setup">
 
    <property resource="defaults.properties"/>
    <echo message="the value of 'script' = '${script}'"/>
 
    <script language="_javascript_"> <![CDATA[
 
      for (i=1; i<=10; i++) {
        echo = squares.createTask("echo");
        main.addTask(echo);
        echo.setMessage(i*i);
      }
 
    ]]> </script>
 
  </target>
 
  <target name="main" depends="setup" />
 
</project>
 

**********************************************************
 
Below is the output when I try to run with it:
 
**********************************************************
 
 
D:\NewWork\SourceRoot>ant -buildfile text2.xml
Buildfile: text2.xml
 
setup:
the value of 'script' = 'org.apache.tools.ant.taskdefs.optional.Script'
 
BUILD FAILED
 
D:\NewWork\SourceRoot\text2.xml:8: Could not create task of type: script because I can't find it in the list of task class definitions.  Com
mon solutions are: 1 execute bin/bootstrap. 2 use taskdef to declare your task. 3 add the task to defaults.properties.
 
Total time: 1 second
D:\NewWork\SourceRoot>
 
********************************************************

Reply via email to