You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jo Support <jo...@gmail.com> on 2010/12/14 12:09:29 UTC

propertyfile task and escaping

Hello,

Scenario: Ant 1.8.0 on WinXP

is there a way to avoid escaping chars by propertyfile task?

The following task

<propertyfile file="myFile.properties">
	<entry  key="MY_URL" value="http://mydomain/"/>
</propertyfile>

produces the following file

MY_URL=http\://mydomain/

that is bad.
I know there are other solutions, like echoing a new property file
(but I have a lot of other properties inside the file that I don't
have to change, and I would like not to list them just because of the
new file creation) and/or using the simple replace task (but I should
know the original value of the property to indicate the token, and I
don't know it).

Any suggestion?

Thanks a lot
Jo

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


Re: propertyfile task and escaping

Posted by Antoine Levy-Lambert <an...@gmx.de>.
On 12/14/2010 6:09 AM, Jo Support wrote:
> Hello,
>
> Scenario: Ant 1.8.0 on WinXP
>
> is there a way to avoid escaping chars by propertyfile task?
>
> The following task
>
> <propertyfile file="myFile.properties">
> 	<entry  key="MY_URL" value="http://mydomain/"/>
> </propertyfile>
>
> produces the following file
>
> MY_URL=http\://mydomain/
>
> that is bad.
This is not bad, this is the convention for java property files which 
ant is following.
> I know there are other solutions, like echoing a new property file
> (but I have a lot of other properties inside the file that I don't
> have to change, and I would like not to list them just because of the
> new file creation) and/or using the simple replace task (but I should
> know the original value of the property to indicate the token, and I
> don't know it).
>
> Any suggestion?
I think using concat you could do what you want. You want to concatenate 
the old (or template) property file together with the other properties 
that you are
generating on the fly.
> Thanks a lot
> Jo
>
Antoine

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