The way to set properties conditionally is to use the condition
task:
<condition property="war.suffix" value="-1.6" else="">
<equals arg1="${ant.java.version}" arg2="1.6"/>
</condition>
<war warfile="${dist.dir}/mywar${war.suffix}.war">
The trick here is that the else=""
means that war.suffix
will be an empty string on any version other than 1.6.