I'd like to use a filterset to write out a file replacing a variable which is set as an ant property. I can pass the property if I have a nested filterset, but not a refid; I'm reusing the filterset, so I'd like to use the refid.
foo.old just contains foo=@foo@
This works:
<target name="filterset-test1"> <property name="bar" value="here is foo" /> <copy file="foo.old" tofile="foo.new1"> <filterset begintoken="@" endtoken="@"> <filter token="foo" value="${bar}" /> </filterset> </copy> </target>
And this fails to replace the token:
<filterset id="test-filters" begintoken="@" endtoken="@"> <filter token="foo" value="${bar}" /> </filterset> <target name="filterset-test3"> <property name="bar" value="property doesn't pass thru" /> <copy file="foo.old" tofile="foo.new3"> <filterset refid="test-filters" /> </copy> </target>
Is there a way to do the latter? I've also tried writing a properties file and using it as the filtersfile
property.