ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RADEMAKERS Tanguy <tanguy.rademak...@swift.com>
Subject Re: Problems with available
Date Tue, 30 Mar 2004 13:45:58 GMT
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)

/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


Mime
View raw message