ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: AW: more than one property file (-propertyfile)
Date Thu, 10 Apr 2003 10:06:35 GMT
Also, (I know, because I coded this mechanism), if you use 
-Dprop=another it will use that one no matter where it appears in the 
command-line, regardless of other -propertyfile's that set that prop.  
:)

	Erik


On Thursday, April 10, 2003, at 03:25  AM, Jan.Materne@rzf.fin-nrw.de 
wrote:

> Simple test:
>
> build.xml
> --------------------------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <project name="test" basedir="." default="main">
>     <target name="main">
>         <echo>$${prop} = ${prop}</echo>
>         <echo>$${a}    = ${a}</echo>
>         <echo>$${b}    = ${b}</echo>
>     </target>
> </project>
>
>
> a.properties
> --------------------------------------------------
> prop=A
> a=A
>
>
> b.properties
> --------------------------------------------------
> prop=B
> b=b
>
>
>
> ant -propertyfile a.properties
> main:
>      [echo] ${prop} = A
>      [echo] ${a}    = A
>      [echo] ${b}    = ${b}
>
>
> ant -propertyfile b.properties
> main:
>      [echo] ${prop} = B
>      [echo] ${a}    = ${a}
>      [echo] ${b}    = b
>
>
> ant -propertyfile a.properties -propertyfile b.properties
> main:
>      [echo] ${prop} = A
>      [echo] ${a}    = A
>      [echo] ${b}    = b
>
>
>
> So the answer: all files are loaded and - because properties are 
> immutable -
>
> first wins.
>
>
>
> Jan Matèrne
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: Oliver Wulff [mailto:oliver.wulff@zurich.ch]
>> Gesendet am: Donnerstag, 10. April 2003 09:20
>> An: ant-user@jakarta.apache.org
>> Betreff: more than one property file (-propertyfile)
>>
>>
>>
>>
>>
>> Hi
>>
>> I have to property files which I want to add to the ant call:
>> ant -propertyfile c:/a.properties -propertyfile c:/b.properties build
>>
>> Which property will be used if both files contain the same property?
>>
>> Oliver
>>
>>
>>
>>
>>
>>
>> ******************* BITTE BEACHTEN *******************
>> Diese Nachricht (wie auch allfällige Anhänge dazu) beinhaltet
>> möglicherweise vertrauliche oder gesetzlich geschützte Daten oder
>> Informationen. Zum Empfang derselben ist (sind) ausschliesslich die
>> genannte(n) Person(en) bestimmt. Falls Sie diese Nachricht
>> irrtümlicherweise erreicht hat, sind Sie höflich gebeten, diese unter
>> Ausschluss jeder Reproduktion zu zerstören und die absendende Person
>> umgehend zu benachrichtigen. Vielen Dank für Ihre Hilfe.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>


Mime
View raw message