ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunnar Boström <Gunnar.N.Bost...@telia.se>
Subject RE: if, unless problems
Date Fri, 08 Dec 2000 09:25:15 GMT
Stefan,
I understand your explanation but I think the "concept" is difficult to
understand. In all(most?) other situations in ant it is the value of the
property that is interesting not its existens.   
My suggestion is that if/unless should check the value for true/false and if
the property doesn't exists the value should be interpreted as false. 
For backward compatibility if/unless could support both propname and
${propname}.
Comments??

:-)



> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@apache.org]
> Sent: den 8 december 2000 10:01
> To: ant-user@jakarta.apache.org
> Subject: Re: if, unless problems
> 
> 
> Alexander V. Gorlov <ales@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
> 

Mime
View raw message