views:

120

answers:

1

I have a ant property app.prod= production

During the an build, I want to replace all files in a particular directory with production in its name to same nma e without 'production' in it.

Example

File names are

  1. abcproduction.xls
  2. cdeproduction.xls

I want to remove change the file names to abc.xls cde.xls

<regexpmapper from="(.*)${app.prod}(.*)" to="\1\2" />   FAILS
<regexpmapper from="(.*)(${app.prod})(.*)" to="\1\2" />   FAILS

<regexpmapper from="(.*)production(.*)" to="\1\2" />   WORKS!!

BUT I want to use the property - app.prod Any suggestions

A: 

Clarification File names are : 1. abcproduction.xls 2. cdeproduction.xls

I tried the below command

<regexpmapper from="(.*)(${app.prod})(.*)" to="\1\2" /> 

It fails

Then I tried

<regexpmapper from="(.*)${ems.env}(.*)" to="\1\2" /> 

This also fails.

What works is hardcoding

<regexpmapper from="(.*)production(.*)" to="\1\2" /> 
Manoj
Stackoverflow is not allowing ant script to be pasted. Anyone knows why<regexpmapper from="(.*)(${ems.env})(.*)" to="\1\2" />
Manoj
Please delete this "answer", or start earning negative points.
Alexander Pogrebnyak