ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <>
Subject Re: <property file=... problem
Date Tue, 19 Feb 2002 17:43:47 GMT
Properties are *immutable*.  Once set they cannot be changed.  This is
intentional and very much by design.

One thing I was thinking of doing is enhancing the <property> task to take a
'prefix' attribute that would prefix all properties set if specified.
Anyone against such a change?

I'm not sure how you could accomplish what you desire without this change,
although I'm sure there are some hacks to workaround it (use <propertyfile>
to write out a new properties file and morph the property name slightly, for
example, and then load in the new properties file too).


----- Original Message -----
From: "Lev Zak" <>
To: "'Ant Users List'" <>
Sent: Tuesday, February 19, 2002 12:28 PM
Subject: <property file=... problem

> I use ANT 1.4.1 on Windows 2000.
> I need to compare two properties (build number) that I take from a two
> different file.
> I have two installation in the different directory (d:/app1 and d:/app2)
> I would like to compare if this is the same build. For this I have a sign
> build number into the file under buildNumber key (e.g.
> buildNumber=200202031611).
> The part of build.xml target is a following:
> <target name="compare_build_number">
>     <property name="build.prop.1" value="d:/app1/"/>
>     <property name="build.prop.2" value="d:/app2/"/>
>     <property file="${build.prop.1}"/>
>     <property name="app1_ver" value="${buildNumber}"/>
>     <property file="${build.prop.2}"/>
>     <condition property="it_is_the_same_build">
>         <equals arg1="${app1_ver"}" arg2="${buildNumber}"/>
>     </condition>
> . . .
> I expected two defined values, app1_ver is a buildNumber of first
> application (d:/app1/ and buildNumber is a buildNumber of
> second application (d:/app2/, before a <condition> task
> I could to compare this values. But it is not happened.  The second
> "<property file=" does not work. I tried to separate this target to two
> different targets which use "<property file=" each one. It was not helped.
> tried to use "<property resource=" instead of "<property file=". It was
> helped.
> What is wrong in my build.xml?
> What I missed?
> And what is the difference between <property resource=" and "<property
> file=" ?
> Thanks.
> Lev.
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message