ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sharad" <>
Subject How to get the return value from the <antcall />
Date Mon, 11 Oct 2004 16:45:28 GMT

I want to create a target which can be called using <antcall />. But i want
to get the return value from the called target. Is there a way to get it?

I tried using ant contrib's variable property using <ac:var .../> but the
property value is not returned from the called target. Follows is the code
snipped i tried :

<project name="testing" default="args"
     <taskdef resource="net/sf/antcontrib/"/>

     <ac:var name="ret" value="0"/>
     <target name="args">
         <property name="argument1" value="one"/>
         <antcall target="function">
             <param name="arg1" value="${argument1}"/>
         <echo message="functionReturnvalue = ${ret}"/>

     <target name="function">
         <echo message="arg1 = ${arg1}"/>
                 <ac:var name="ret" value="1"/>
                 <ac:var name="ret" value="2"/>

Thanks and Regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message