One could use the loadfile task to help with this. This task loads the given file into a property. What is really useful is when you apply a filterchain with replacetokens to replace certain areas of the file. For example if one were to define a template-like header file that looked something like this:
#ifndef MyMacros_h
#define MyMacros_h
#define SERVER_ADDRESS "@SERVER_ADDRESS_TOKEN@"
#endif
One could the use the loadfile task to replace the @SERVER_ADDRESS_TOKEN@ with any string, and then use the echo task to actually write the real header file back out.
<loadfile file="MyMacrosTemplate.h" property="theMacrosFileContents">
<filterchain>
<replacetokens>
<token key="SERVER_ADDRESS_TOKEN" value="www.customerserver.net" />
</replacetokens>
</filterchain>
</loadfile>
<echo file="MyMacros.h" message="${theMacrosFileContents}" />
This will generate a MyMacros.h file with the modified string for the SERVER_ADDRESS.