ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conelly, Luis (GE Energy, Non GE, GENE)" <Luis1.Cone...@ge.com>
Subject RE: How to get the return value from the <antcall />
Date Mon, 11 Oct 2004 16:54:42 GMT
there's an Ant-Contrib feature... I think it's <antcallback> [1] which has
something related... 
[1] http://ant-contrib.sourceforge.net/tasks/antcallback_task.html

HTH

-----Original Message-----
From: Sharad [mailto:sharad@persistent.co.in]
Sent: Monday, October 11, 2004 11:45 AM
To: Ant Users List
Subject: How to get the return value from the <antcall />


Hi,

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"
xmlns:ac="antlib:net.sf.antcontrib">
     <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

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

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

Thanks and Regards,
Sharad.


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

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


Mime
View raw message