Here is an example ant target which explains how to read from a properties file in ant.
//Build.xml
//config.properties
//Build.xml
- <project name="Sample" default="delete-dir" basedir=".">
- <!-- Read the properties file -->
- <property file="config/config.properties" prefix="config"/>
- <!-- Using the property value(read from file) in ant's preperty attribute-->
- <property name="build.loc" value="${config.build_dir_loc}" />
- <!-- Delete directories that are not needed -->
- <target name="delete-dir" >
- <delete dir="${build.loc}"/>
- <echo> /* Directory deleted successfully ! */ </echo>
- </target>
- </project>
//config.properties
- username = aksahu
- password = aksahu123
- url = http://quickprotech.blogspot.in/
- port = 4444
- build_dir_loc = E:/temp/build