GeeCON Prague 2014*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to modify an INI configuration file via ANT build.xml ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to modify an INI configuration file via ANT build.xml ?" Watch "How to modify an INI configuration file via ANT build.xml ?" New topic
Author

How to modify an INI configuration file via ANT build.xml ?

Jeff Tanner
Greenhorn

Joined: Aug 09, 2010
Posts: 6
Hi

Through an ANT build.xml, I want to modify a setting within a project's config.ini file.

For example, from default setting:
app_service_api=UNDEFINED

to a setting defined within build.xml:
app_service_api=QA

How can I do this

Thanks

Jeff in Seattle

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

You need to add a <filterchain> section to the <copy> task and use the <replacetokens> option (or some other filter chain option). See:
http://ant.apache.org/manual/Types/filterchain.html

Here is a discussion I had about this earlier this year:
http://www.coderanch.com/t/566206/tools/Modify-build-xml-replace-words#2571618


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to modify an INI configuration file via ANT build.xml ?