繁体   English   中英

在ant中复制与正则表达式匹配的文件

[英]Copying files matching a regex in ant

我在复制一些与我的ant脚本中的模式匹配的文件时遇到问题。

我有以下内容:

<property name="IncludedLocales" value="de_DE|es_ES|fr_FR|it_IT|ja_JP" />

<copy todir="${dest}">
            <fileset dir="${src}" includes="**/*.properties" />
            <mapper type="regexp" from="(messages(_${IncludedLocales})?\.properties)" to="\1" />
</copy>

$ {src}包含文件messages.properties以及messages_de_DE.properties,messages_es_ES.properties等。

但是由于某些原因,仅复制messages.properties和messages_de_DE.properties(如果将IncludedLocales更改为“ es_ES | de_DE | fr_FR | it_IT | ja_JP”,则将复制messages_es_ES.properties而不是messages_de_DE.properties)。

我是否错过了一些非常简单的事情?

是的,我确实错过了一些非常简单的事情, (messages(_${IncludedLocales})?\\.properties)应该是(messages(_(${IncludedLocales}))?\\.properties)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM