ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: Problems with available
Date Wed, 31 Mar 2004 18:28:49 GMT
> -----Original Message-----
> From: RADEMAKERS Tanguy [mailto:tanguy.rademakers@swift.com]
> Sent: Tuesday, March 30, 2004 5:46 AM
> To: Ant Users List
> Subject: Re: Problems with available
> 
> 
> Marco,
> 
> Properties in Ant are immutable, once they are set they can't 
> be changed.
> 
> Remove the "<property name="commons.build" value="false" />" line and 
> all should be fine (for the purpose of if and unless attributes, 
> undefined is equivalent to false)

Not quite. Unless and if attributes only check to see if the property exists, not that the
value is "true". So for the purpose of if and unless attributes, "true" is equivalent to "false".

-Rob Anderson

> 
> /t
> 
> 
> Marco Tedone wrote:
> 
> >Hi, following the documentation for available I defined the 
> following:
> >
> >At the top of my project, different properties, like:
> >
> ><!-- Contains the path to a file -->
> ><property name="commons.buildfile" 
> location="../Commons/build.xml" /> 
> >
> ><!-- Contains a value that should be only true/false -->
> ><property name="commons.build" value="false" />
> >
> >
> >I then declared the following target:
> >
> ><target name="prepare-build">
> >    <available file="${commons.buildfile}" 
> property="${commons.build}" />    
> ></target>  
> >
> >that, if finds the build.xml file in ../Commons should set 
> ${commons.build} to true.
> >
> >I've done this for quite several properties.
> >
> >However, what I obtain from the log is the following:
> >
> >log:
> >     [echo] 
> +-------------------------------------------------------------------+
> >     [echo] + P R O P E R T Y  L I S T   B U I L D   F I L E 
> S :                +
> >     [echo] +                                                
>                    +
> >     [echo] + commons.buildfile? = 
> C:\dev\projects\Commons\build.xml                         +
> >     [echo] 
> +-------------------------------------------------------------------+
> >     [echo]
> >     [echo]
> >     [echo] 
> +-------------------------------------------------------------------+
> >     [echo] + P R O P E R T Y  L I S T  B U I L D   Y E S / 
> N O :               +
> >     [echo] +                                                
>                    +
> >     [echo] + Build commons? = false                         
>         +
> >     [echo] 
> +-------------------------------------------------------------------+
> >
> >obtained by the log target as follows:
> >
> ><target name="log">
> >   <echo>
> >+-------------------------------------------------------------------+
> >+ P R O P E R T Y  L I S T   B U I L D   F I L E S :                +
> >+                                                                   +
> >+ commons.buildfile? = ${commons.buildfile}                         +
> >+-------------------------------------------------------------------+
> >   
> >+-------------------------------------------------------------------+
> >+ P R O P E R T Y  L I S T  B U I L D   Y E S / N O :               +
> >+                                                                   +
> >+ Build commons? = ${commons.build}                                 +
> >+-------------------------------------------------------------------+
> >  </echo>
> >  </target>
> >
> >Please help me with this because i don't know what to try more!
> >
> >Thanks,
> >
> >Marco
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
> >  
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message