开发者

propertyregex removes return characters in multiline

开发者 https://www.devze.com 2022-12-26 19:57 出处:网络
I\'m using ants propertyregex method to change a property and it works fine up to a point. I\'m lossing return characters.

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

精彩评论

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

关注公众号