开发者

propertyregex removes return characters in multiline

I'm using ants propertyregex method to change a property and it works fine up to a point. I'm lossing return characters.

Here's what I'm trying to change:

cluster.path=\
${nbplatform.active.dir}/harness:\
${nbplatform.active.dir}/platform:\
${nbplatform.active.dir}/nb

This is in a .properties file.

So I'm trying to change it like this:

<propertyregex property="cluster.path"
               input="${cluster.path}"
               regexp="nbplatform.active.dir"
               replace="xplatform.base"
               global="true"
               override="true"/>

The stuff is replaced but I get:

cluster.path=    ${xplatform.base}/harness\:    ${xplatform.base}/platform\:    ${xplatform.base}/nb

This brakes logic down t开发者_运维问答he line not controlled by me (Netbeans) that uses the ':' as delimiter.

Any idea?


I worked around that changing the file itself like this: replaceregexp file="nbproject/platform.properties" match="nbplatform.active.dir" replace="platform.base" byline="true" flags="g,s"/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜