It's not a secret anymore!
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
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply 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: 5543

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to modify an INI configuration file via ANT build.xml ?
 
Similar Threads
ANT Task to modify XML files?
PVCS task in ANT - unable t run from WSAD
Execute Ant script with Java file
calling perl program thru Ant task
Eclipse and ANT