You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Andrew G. Tereschenko" <ta...@ibis.odessa.ua> on 2000/11/14 15:09:17 UTC
Overriding properties
Hi,
What is expected result of this script in
Ant1.1 and Ant1.2 ??
<?xml version="1.0"?>
<project name="sample" default="all" basedir=".">
<target name="all" depends="sample1,sample2"/>
<target name="sample1">
<property name="prop1" value="sample1"/>
<echo message="${prop1}"/>
</target>
<target name="sample2">
<property name="prop1" value="sample2"/>
<echo message="${prop1}"/>
</target>
</project>
What NEW ???
* Semantics of <property> has changed again in the hope to be more
intuitive. ${} expansion now happens at runtime and <property> tags
living inside of targets only take effect if they are visited at
runtime.
Take a test ...
=============================
Andrew G. Tereschenko
Software Engineer
Integrated Banking Information Systems
tag@ibis.odessa.ua
RE: Overriding properties
Posted by Stanislas Pinte <st...@wanadoo.be>.
I am also strongly in favor of properties overriding.
Without that, project nesting is a nightmare.
Stan
RE: Overriding properties
Posted by "Andrew G. Tereschenko" <ta...@ibis.odessa.ua>.
He-he...
I was asking for 2 results.
In Ant1.1 and Ant1.2
I think we must allow overide properties.
In current sources i see attempt to create
read-only user properties (here is a two
HashTables for this), but looks like
it result all properties can be used only once.
We have a big build.xml (with includes of other build files)
like this:
<target .... />
<property name="dir" value="${root}/start"/>
<jar jarfile="${server}/irbis-start.jar" basedir="${dest}"
includes="
${dir}/IPrincipal.class,
${dir}/IServerLoginModule.class,
"
/>
</target>
<target .... />
<property name="dir" value="${root}/login"/>
<jar jarfile="${server}/irbis-login.jar" basedir="${dest}"
includes="
${dir}/AaaaBbbb.class,
${dir}/CccccDdddd.class,
"
/>
</target>
And i don't want to change it :o(
BTW, overriding propertis (build.compiler) can allow to compile
one part of project by one compiler (jikes) and other one by another (javac)
=============================
Andrew G. Tereschenko
Software Engineer
Integrated Banking Information Systems
tag@ibis.odessa.ua
> -----Original Message-----
> From: Stefan Schmitt [mailto:sschmitt@raleigh.ibm.com]
> Sent: Tuesday, November 14, 2000 4:11 PM
> To: ant-user@jakarta.apache.org
> Subject: Re: Overriding properties
>
>
> I think that the result is
>
> sample1
> sample1
>
> Because of the property prop1 will be set in sample1 first
> and could not be
> overwritten in sample2.
>
> Yours
> Stefan S
>
>
Re: Overriding properties
Posted by Stefan Schmitt <ss...@raleigh.ibm.com>.
I think that the result is
sample1
sample1
Because of the property prop1 will be set in sample1 first and could not be
overwritten in sample2.
Yours
Stefan S