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).
Erik
----- Original Message -----
From: "Lev Zak" <[EMAIL PROTECTED]>
To: "'Ant Users List'" <[email protected]>
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 build.properties file.
> I have two installation in the different directory (d:/app1 and d:/app2)
and
> I would like to compare if this is the same build. For this I have a sign
of
> build number into the build.properties 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/build.properties"/>
> <property name="build.prop.2" value="d:/app2/build.properties"/>
> <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/build.properties) and buildNumber is a buildNumber of
> second application (d:/app2/build.properties), before a <condition> task
and
> 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.
I
> tried to use "<property resource=" instead of "<property file=". It was
not
> 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: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>