I’ve a big project which its build automation is being done by ant. I need some ideas or solutions to change some common variables across all files.
For example, the companies name, product name or year are contained in many files: help files (html), license and config files (txt, xml), source code (java->class) etc. Is there an easy way to set a variable for these and make all the files change with a snap? Different tools are welcome, too.
There is always the option to add some code to open the file, find the location and change the string but this seems not an elegant solution.
Thank you.
I like the following ANT solution:
http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/
Use a replaceregexp task to find and fix Java files missing a license header:
Simple and doesn’t require substitution tokens in the Java source.