Actually, the answer provided by @GnanaPrakash is incomplete. From Ant Contrib documentation:
These conditions are suitable for use in an element. Unfortunately, they cannot be used in <condition> but all conditions for a task can be used with <bool> and <bool> can be used anywhere where <condition> can be used.
So, islessthan
or alternative isgreaterthan
elements should be wrapped in a bool
element as follows:
<property name="small" value="15" /> <property name="big" value="156" /> <if> <bool> <islessthan arg1="${small}" arg2="${big}"/> </bool> <then> <echo message="small is less than big!" /> </then> <else> <echo message="big is less than small!" /> </else> </if>
If you do not, you will receive an error message:
if doesn't support the nested "islessthan" element.
Mig82 source share