You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2000/12/08 10:01:20 UTC

Re: if, unless problems

Alexander V. Gorlov <al...@vis.infotel.ru> wrote:

> I use successfully next code:
> 
>      <property name="Version1" value="true"/>
>      <property name="false" value="false"/>
> <target ...>
> <copy ...>
>       <fileset dir="${dir}">
>         <include name="**/*.xml" if="${Version1}"/>
>         <include name="**/*.xsl" if="${Version1}"/>
>       </fileset>
> </copy>
> but code like don`t work
> <target ... if="${Version1}">
> 'if' in the target work only when I use if="constant".
> This is design features or I do something wrong?

Two notes: (1) if/unless expect the _name_ of a property, so it is
if="Version1" instead of ${Version1} and (2) they test for the
existance of a property, not its value - setting the property to true
or false doesn't make any difference.

Stefan