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.
This task is used to load file into a property. It works on files and provides a srcFile attribute for ease. It uses default encoding current locale unless other one is specified.
To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.
Get rid of the property definition line. Properties are immutable.
<project name="foobar" default="foo">
<target name="foo">
<loadfile property="foo.bar" srcFile="foobar/moo.txt"/>
<echo>${foo.bar}</echo>
</target>
</project>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With