Hi Uday,

Here are 2 solutions for an if-else in Ant:

1) Using you just use plain Ant 1.7, you can use the <condition> task, combining 'if' and 'unless' target attributes with target dependencies, as follows:

<target name="main" depends="A, B"/>

<target name="A" if="condition.ok" depends="eval.condition">
   ...
</target>

<target name="B" unless="condition.ok" depends="eval.condition">
   ...
</target>

<target name="eval.condition">
   <condition property="condition.ok">
       <resourcecount count="1" when="ge">
           <fileset file="text_file.txt">
               <contains text="String to search" casesensitive="false"/>
           </fileset>
       </resourcecount>
   </condition>
</target>

2) The way I do it: just use ant-contrib's implementation of <if><then><else> :) (see: http://ant-contrib.sourceforge.net/)

Olivier

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to