ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jful...@ruminate.co.uk
Subject Re: can ant write to property file?
Date Sat, 28 Aug 2004 01:05:07 GMT
"Yiling Lu" <ylu@invoqsystems.com> wrote ..
> I want to let ant write a name/value pair to the property file, is there
> a way to do this?

property files are just files....

if u want to find and replace a value in an existing property file just use the <replace/>
task...
http://ant.apache.org/manual/CoreTasks/replace.html

or barring token replacement u need to match using regular expression
http://ant.apache.org/manual/OptionalTasks/replaceregexp.html

Ant has a variety of methods for finding and replacing stuff...for example you could load
a property file and filter as you go....
http://ant.apache.org/manual/CoreTypes/filterchain.html

one lo tech method you may use <echo/> to write to a file
http://ant.apache.org/manual/CoreTasks/echo.html

lastly if you use XML property files you could use a deep copy xslt identity transformation...replacing
only the XML you want.....


gl, Jim Fuller






Mime
View raw message