This should be all you need to do:
1.Grab the latest version of ant-contrib JAR and place in lib
folder of your Ant installation.
2.Include your properties in your build script
<property file="build.properties"/>
3.Add the following taskdef entry to your build script
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
4.And then finally, define an if task like so:
<if>
<equals arg1="${on}" arg2="1" />
<then>
<echo message="I am going to do something here" />
</then>
<else>
<echo message="I am going to do nothing" />
</else>
</if>
Note that you can prepend an identifier to properties you import from property files. So for example you could do your import like so:
<property file="build.properties" prefix="uniqueprefix"/>
And then you would reference in your file, 'uniqueprefix.on', instead of just 'on'.
<equals arg1="${uniqueprefix.on}" arg2="1" />
You can use the built-in conditional task from Ant, but I have a feeling that if you need it you are better off with the extra functions that ant-contrib brings to the table. Also, note that its standard to name your build file as 'build.xml', and not 'ant.xml'. As it is, Ant will not be able to automatically locate it, given the name you have used. Good luck.