ant: best way to setup system-dependent properties?

ant

Solution

In addition to Vladimir's solution you might have a default properties file for each of the OS or other you might deploy your build system on. Use the ${os.name} (and other Java system properties) to set up a path. For example

<property file="build-${os.name}.properties">

These files can be maintained and checked in into your version control system as well.

Problem

I have a number of file/executable locations that are likely to be different depending on which computer I am running them on, and I would like to abstract these out through ant properties somehow. What's the best way to do this? Is there a system-wide ant setup script that gets called? Or can I make such a script?

Original source