ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritchie <ganesh.devaraj...@baml.com>
Subject Re: Alternative to if else task.
Date Fri, 11 Feb 2011 15:49:46 GMT

Matt,
  The target option would be good if the other target does not fail, but in
my build file i have target which executes perforce command and i capture
the result of the exec task in resultproperty. If the value of result
property is ==0 then i execute another target else execute a different
target.

<target name="testperforce" depends="stage">
    <exec executable="p4.exe" spawn="false" failonerror="false"
resultproperty="p4result">
    <arg value="changes"/>
    <arg value="-m1"/>
    <arg value="${file.name}"/>
    </exec>
   <if name="p4result" value="0">
   <antcall target ="p4changes"/>
   </if>
   <else>
   <antcall target="defaultchangenumber"/>
   </else>
</target>
-- 
View this message in context: http://ant.1045680.n5.nabble.com/Alternate-for-if-else-task-tp3381392p3381432.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