Jump to content

Apache Ant/Best Practices/Local Property Files

From Wikibooks, open books for an open world

Using a Property file

[edit | edit source]

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
 antHome=C:/Apps/apache-ant-1.6.5
 Saxon8HomeDir=C:/Apps/saxon8
 saxon8jar=${Saxon8HomeDir}/saxon8.jar
 # used to make sure Saxon gets the right XSLT 2.0 processor
 processor=trax