ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hunter Peress" <>
Subject Did i reinvent the wheel with greaterthan?
Date Thu, 12 Oct 2006 21:17:37 GMT
Im using ant-contrib to implement a greater-than (for ints only)
Did I miss something in the documentation? Or is this the best approach (i
realize I could have written a custom ant task)

Did i reinvent some wheel in ant?

  <target name="t">
    <taskdef resource="net/sf/antcontrib/antlib.xml">
       <pathelement location="ant-contrib-0.6.jar"/>

    <macrodef name="greaterthan">
       <attribute name="resultprop" default="NOT SET"/>
       <attribute name="arg1" default="NOT SET"/>
       <attribute name="arg2" default="NOT SET"/>
         <math result="gt_tmp" datatype="int">
           <op op="max" >
             <num value="@{arg1}"/>
             <num value="@{arg2}"/>
           <equals arg1="@{arg1}" arg2="${gt_tmp}" />
             <property name="@{resultprop}" value="1" />
             <property name="@{resultprop}" value="0" />

    <greaterthan arg1="100" arg2="20" resultprop="well" />

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message