ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NR031 <nataraja...@cognizant.com>
Subject Re: How to use nested if in ant script?
Date Fri, 06 Mar 2009 09:15:39 GMT

Hi Peter, 

    Thanks for your quick reply.

===============================================================================

Peter Reilly-2 wrote:
> 
> <if>
>    <and>
>        <equals arg1="abc" arg2="abc"/>
>        <equals arg1="def" arg2="def"/>
>    </and>
>     <then>
>     </then>
>     <else>
>     </else>
> </if>
> 
> On Fri, Mar 6, 2009 at 8:45 AM, NR031 <nataraja.cp@cognizant.com> wrote:
>>
>> Hi all,
>>
>>
>>    I found out the solution myself :
>>
>> <if>
>>            <equals arg1="abc" arg2="abc"/>
>>            <then>
>>                <if>
>>                    <equals arg1="def" arg2="def"/>
>>                    <then>
>>                        <echo>success</echo>
>>                        <property name="letter" value="abcdef" />
>>                        <echo>${letter}</echo>
>>                    </then>
>>                </if>
>>            </then>
>>            <else>
>>                <echo>Not equal</echo>
>>            </else>
>>        </if>
>>
>> ===============================================================================
>>
>> NR031 wrote:
>>>
>>> Hi,
>>>
>>>     How do I use nested <if> tag in ant script. I want to check 2
>>> strings
>>> and if both are true then it has to do some action. I did like this but
>>> getting You must not nest more than one condition into if
>>>
>>> <if>
>>>             <equals arg1="abc" arg2="abc"/>
>>>             <and>
>>>                 <equals arg1="def" arg2="defl"/>
>>>             </and>
>>>             <then>
>>>                 <echo>success</echo>
>>>                 <property name="letter" value="abcdef" />
>>>             </then>
>>> </if>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-use-nested-if-in-ant-script--tp22368213p22368288.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-use-nested-if-in-ant-script--tp22368213p22368727.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Mime
View raw message