ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gladdish <martin.gladd...@egsgroup.com>
Subject Re: Clearing a property
Date Tue, 08 Mar 2005 13:12:44 GMT
Thanks,

that sorted it.


On 8 Mar 2005, at 12:22, Peter Reilly wrote:

> Martin Gladdish wrote:
>
>> All,
>>
>> I'm struggling with clearing a property value that was set using the 
>> <loadfile> task.
>>
>> Here's the relevant section of my build file:
>>
>>         <loadfile property="web-xml-fragment" 
>> srcFile="${target.custom.src.dir}/generated_web.xml"/>
>>         <filter token="precompiled_jsp" value="${web-xml-fragment}"/>
>>         <copy file="${source.web.dir}/WEB-INF/web.xml" 
>> tofile="${target.custom.webinf.dir}/web.xml" filtering="true" 
>> overwrite="true" />
>>         <property name="web-xml-fragment" value="nothing"/>
>>         <echo>web-xml-fragment: ${web-xml-fragment}</echo>
>>
>> The web-xml-fragment property gets set correctly, and I get the 
>> correctly filtered web.xml out at the end of the <copy> task. That's 
>> all fine.
>> I then set the web-xml-fragment property to be "nothing".
>> The <echo> statement should then just print the word "nothing", 
>> shouldn't it?
>
> No, by design ant properties can not be set more that once.
>
>>
>> In fact, it prints the contents of generated_web.xml.
>>
>> So,  <property name="web-xml-fragment" value="nothing"/>, in fact 
>> doesn't appear to set anything.
>>
>> I need to clear the property, so that it doesn't overwhelm my junit 
>> reports.
>
> I see the problem...
> There is a proposal to allow an option to be given to junit to suppress
> reporting of the properties. (cannot remember the bugzilla number at 
> the moment).
>
> In the meantime, you could use the "<var>" task from ant-contrib to 
> reset the property.
> <ac:var name="web-xml-fragment" value="nothing" 
> xmlns:ac="antlib:net.sf.antcontrib"/>
>
> Peter
>
>>
>> ant -version
>> > Apache Ant version 1.6.2 compiled on July 16 2004
>>
>> Any help would be greatly appreciated.
>>
>> Many thanks,
>>
>> Martin Gladdish
>> e-Government Solutions (UK) Ltd
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
Martin Gladdish
e-Government Solutions (UK) Ltd
Tel: 020 7539 2823


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


Mime
View raw message