This should be a simple one. I had another codebase that this worked but for some reason it wont work here at all. My file will.txt is unmodified.
Here is an exerp from my ant build file ..
Any ideas Ive wasted hours already banging my head trying to get it to work.
<loadfile
property="config.update.list"
srcFile="config.update.list" failonerror="true">
<filterchain>
<replacetokens>
<token key="__PRODUCT_VERSION__" value="CATTY"/>
</replacetokens>
<striplinebreaks/>
</filterchain>
</loadfile>
<echo>${config.update.list}</echo>
Below is contents of the file config.update list
/tmp/will.txt
Below is the contents of /tmp/will.txt
@__PRODUCT_VERSION__@ will
From Alexander Pogrebnyak’s comment. Attribute
srcFileshould point to file name/tmp/will.txt:Or if file name is stored in this property then you should use
srcFile="${config.update.list}". Anyway, ant doesn’t allow you to change value of the properties. So you can’t useproperty="config.update.list"for output if it’s already set. Try to use other property for output: