From: Daryl Coutinho
To: 'ant-dev@jakarta.apache.org '
Sent: Wednesday, September 05, 2001 12:31 AM
Subject: using antcall from javascript

hi,
well i've been trying to use the script tag to call another target, but i always get a null pointer exception. my code looks like this:

<project name="sample" default="test" basedir=".">
        <target name="test">
                <property file="../build.properties" />
                <script language="javascript"> <![CDATA[
                                antcall=sample.createTask('antcall');  
                                antcall.init();
                                antcall.setTarget('some');
                                antcall.execute();
                ]]> </script>
        </target>
        <target name="some">
                <echo message="inside some" />
        </target>
</project>

Am i missing something here. Any help would be appreciated

Unfortunately you don't tell us the Ant version you are using. Your example works fine for me using Ant 1.4, so I suggtest you should try this.

(And please read http://jakarta.apache.org/site/mail.html)

Nico