Apache Ant/Best Practices/Local Property Files

Using a Property file


One of the best ways to keep your build files free of local dependencies is to use a local property file

  <property file="local.properties"/>

Here is a sample of a property file:

 # Property file for Project X
 # Author
 # Date
 # Note that the format of this file adheres to the Java Property file specification
 # http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load(java.io.Reader)
 # to use the file put the following in your ant file:
 # <propertyfile file="my.properties">
 # All file names on local hard drives should be stored in this directory
 # Where Ant is installed.  Will not work with 1.5 due to exec/spawn calls
 # used to make sure Saxon gets the right XSLT 2.0 processor