Dear NAnt developers,
the documentation of the expandproperties filter says:
"Note: Due to limitations on buffering, expressions longer than 2048 characters are not guaranteed to be expanded."
But I think I've managed to screw up my build using a different approach: I'm using nested properties like this ${'${X}'} to do a two-step replacement.
The following basic script should replace all occurences of '${replacement.token}' in the file 'test.txt' with the string '${new.token}'.
<!-- the following line should result in a property 'replacement.token' that holds the string '${new.token}' -->
<property name="replacement.token" value="${'${new.token}'}" />
<copy file="test.txt" tofile="test2.txt">
<filterchain>
<expandproperties />
</filterchain>
</copy>
Ususally this works very well. But depending on the file size of 'test.txt' and the position of the replacement token within the file it fails with the error message
"Property 'new.token' has not been set."
even though the expression '${new.token}' is supposed to be considered as a string and not as another token that needs to be replaced.
I've created some sort of a unit test for you which points out where the problem is. Please have a look at the attached script.
Thank you in advance
Daniel
NAnt based test script to analyze the expandproperties problem