• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

copy environment specific property files using ant

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm trying to copy property files to their right environment using ant.

Suppose, I have three files like below

jsp-dev.properties, jsp-test.properties, jsp-prod.properties.

Now, I would like my ant script to copy right file to the right environment.

if I give env in build.properties as dev, it should trim "-dev" from the file and copy the file to dev.
like copy jsp-dev.properties to jsp.properties and push to dev environment.

Can anyone help me here?

Thanks,
 
author & internet detective
Posts: 42003
911
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at the <propertyRegexp> task in Ant Contrib. it lets you grab regular expressions from a property. Which means you can search for dev, store it in another property and replace it with an empty string.
 
nlr reddy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:Take a look at the <propertyRegexp> task in Ant Contrib. it lets you grab regular expressions from a property. Which means you can search for dev, store it in another property and replace it with an empty string.



thanks.

I have used mapper to rename and copy the file.
 
this is supposed to be a surprise, but it smells like a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic