ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: Immutable properties aren't really immutable
Date Fri, 05 Apr 2002 18:20:17 GMT
There were (and still are a few even in the nightly builds) some holes in
the property immutability.  Many of them have been patched, but some must
remain for backwards compatibility.

You're best bet is to avoid using <condition> on a property name that is
already in existence.  Why couldn't you just replace that condition with:

    <property name="weblogic.home.dir" value="${env.WEBLOGIC_HOME}"/>

??  Would that not have the same effect as what you're trying to get at, and
does take advantage of Ant's property immutability rules.

    Erik


----- Original Message -----
From: "Brian Murray" <brian.c.murray@vanderbilt.edu>
To: <ant-user@jakarta.apache.org>
Sent: Friday, April 05, 2002 11:36 AM
Subject: Immutable properties aren't really immutable


> OK, I give up.  I'm just about ready to switch to make and I don't even
> know what make is.
>
> I've had the "properties are immutable" message drilled into me.  So,
> can anyone explain how this set of tasks:
>    <echo message="WLHome (unset)= ${weblogic.home.dir}"/>
>    <property file="${user.home}/delegationtree.ant.properties"/>
>    <echo message="WLHome (user file)= ${weblogic.home.dir}"/>
>    <property file="build/delegationtree.ant.properties"/>
>    <echo message="WLHome (project file)= ${weblogic.home.dir}"/>
>    <property environment="env"/>
>    <condition property="weblogic.home.dir" value="${env.WEBLOGIC_HOME}">
>       <not>
>          <equals arg1="${env.WEBLOGIC_HOME}"
> arg2="$${env.WEBLOGIC_HOME}"/>
>       </not>
>    </condition>
>    <echo message="WLHome (environment)= ${weblogic.home.dir}"/>
>
> Can produce this output (in ant 1.4.1):
>
> Property ${weblogic.home.dir} has not been set
>      [echo] weblogic.home.dir (unset)= ${weblogic.home.dir}
>  [property] Loading home\delegationtree.ant.properties
>      [echo] weblogic.home.dir (user file)= c:/beasp2/wlserver6.0
>  [property] Loading build\delegationtree.ant.properties
>  [property] Override ignored for weblogic.home.dir
>      [echo] weblogic.home.dir (project file)= c:/beasp2/wlserver6.0
>  [property] Loading Environment env.
>      [echo] weblogic.home.dir (environment)= C:\bea61\wlserver6.1
>
> How can ${weblogic.home.dir} change from what was set in the first
> property file?
> __________________________________________________________________
> Brian Murray
> Vanderbilt University
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message