views:

28

answers:

1

If a project depends on other libraries whose locations are non-standard, where should the locations be stored? My current solution is to have something like this at the top of the Ant build.xml script:

<!-- change these properties to point to the correct library locations on your system -->
<property name="lib.foo" location="${user.home}/foo" />
<property name="lib.bar" location="${user.home}/bar" />

This works great if your libraries are installed in those locations. However, it is problematic for users that have them installed elsewhere because your changes get blown away when you svn update.

What is the best practice for allowing a user's local changes to persist between updates, but at the same time being able to provide default locations?

+3  A: 

Add a property entry such as:

<property file="user.properties" />

to the very beginning of your ant script, followed by property entries defining the default values. (See: Ant Docs.) This technique allows each user to (optionally) override the default values with a local file.

If you add user.properties to the svn:ignore list, then it won't get checked in or modified by SVN and each user can have their own custom version of the file.

ChrisH