How do you load a file into a variable in ant using the 'loadfile' task?

ant, ant-loadfile

Solution

Properties are immutable in Ant. The first definition of file.configs.txt will prevent it from being set again.

From: http://ant.apache.org/manual/Tasks/property.html

Properties are immutable: whoever sets a property first freezes it for the rest of the build; they are most definitely not variables.

Problem

I'm trying the following and it doesn't seem to work. ``` <property name="file.configs.txt" value="" /> ... <target name="..."> <loadfile property="file.configs.txt" srcFile="remoteConfig/configs.txt" /> </target> ``` I read here that the <loadfile> task is supposed to load the contents of a file into the specified property.

Original source