Pregunta

I'm having trouble copying some files which match a pattern in my ant script.

I have the following:

<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} contains the files messages.properties, as well as messages_de_DE.properties, messages_es_ES.properties, etc.

But for some reason, only messages.properties, and messages_de_DE.properties get copied (and if I changed IncludedLocales to 'es_ES|de_DE|fr_FR|it_IT|ja_JP', messages_es_ES.properties gets copied instead of messages_de_DE.properties).

Am I missing something really simple?

¿Fue útil?

Solución

Yes, I did miss something really simple, (messages(_${IncludedLocales})?\.properties) should have been (messages(_(${IncludedLocales}))?\.properties)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top