You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jochen Hagenström <jo...@hagenstroem.net> on 2004/11/12 20:22:29 UTC

Re: [genuine] Re: getUserProperty and getProperty

cool. it's working!

-jacques

Am 11.11.2004 um 20:09 schrieb Peter Reilly:

> lists@bitfaeule.net wrote:
>
>> Peter,
>>
>> Thank you very much. This helps me a lot.
>>
>> Will properties I set with  project.setNewProperty() persist, for the
>> liftime of the build? So I can set my property in one target and
>> derefereence it in another?
>>
>>
> Yes,
> It will work exactly the same as using the property task.
> <property name="name" value="value"/>
>
> Peter
>
>> -jacques
>>
>> =========
>> User properties are those specified on the command line. They are 
>> always
>> inherited when across <ant/> boundaries.
>>
>> You should use project.setNewProperty() to set a normal property. - 
>> this
>> maintains property imutablity.
>> project.getProperty() is used to retrieve the value of a property 
>> (this
>> may
>> be a normal property or a user property).
>>
>> An example of setting properties is in
>> src/main/org/apache/tools/ant/taskdefs/CheckSum.java
>>
>> Peter
>>
>>
>> lists@bitfaeule.net wrote:
>>
>> Hi folks,
>>
>> What is the exact difference between the API-calls  getUserProperty 
>> and
>> getProperty. And:
>> What is the exact difference between the API-calls  setUserProperty 
>> and
>> setProperty. When ist advised to use which?
>>
>> I'm a bit confused. I am writing my own tasks and I have started to 
>> use
>> getUserProperty because it did what I wanted but I didn't know that
>> [s|g]etProperty existed.
>>
>> Thanks for enlightenment.
>>
>> -jacques
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
::: Jochen Hagenström
::: www.hagenstrom.de
::: post@hagenstrom.de



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