You can put something like this in your build file:
<property file="${user.home}/.ant.properties"/>
and have people create their own .ant.properties file if they want to
override (some of) the defaults.
--
Martin Cooper
Tumbleweed Communications
----- Original Message -----
From: "Phillip Lord" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 7:44 AM
Subject: setting properties on a per user, per project basis
>
>
>
> Apologies for a second post in two days!
>
>
> Is it possible to set properties on a per user basis and
> per project basis?
>
> I've now got ant up and running quite nicely, and have
> written my first build file (which took me about 1/5 the time it took
> me to get my first Makefile written, which is I think a positive
> thing!).
>
> I want to write a buildfile which is nice and generic, so
> at the beginning I have set up the following...
>
>
> <!-- Where to find the route directory of the source hierarchy -->
> <property name="src" value="../../../.."/>
>
> <!-- Where should the class files that are produced by put -->
> <property name="classes" value="${src}"/>
>
> <!-- Where should the distributable jar files be generated -->
> <property name="dist" value="${src}"/>
>
> <!-- Where are the additional jar files required for the compilation -->
> <property name="ext" value="${classes}/ext"/>
>
> <!-- Compile with debug on or not -->
> <property name="debug" value="off"/>
>
>
> This is fine, and will work as a build for my
> distributable. The problem is that it does not really suit my file
> system. So I have over-ridden these properties on the command
> line. Currently I am launching ant with....
>
>
>
nt -emacs -Dbuild.compiler=jikes -Dbuild.compiler.emacs=true -Dclasses=~/
include/java -Dext=~/include/ext -Ddist=~/scratch
>
> which is a bit of a mouthful, and I can tell that its only
> going to get longer.
>
> The approach that I have taken to get around this is to
> stick this...
>
> <!--
> In this section I am defining the local variables that I use to
> customise the build process for my own nefarious ends.
>
> Local Variables: ***
> compile-command: ("ant -emacs \
> -Dbuild.compiler=jikes \
> -Dbuild.compiler.emacs=true \
> -Dclasses=~/include/java \
> -Dext=~/include/ext \
> -Ddist=~/scratch" ) ***
> End: ***
> -->
>
> at the bottom of my file, which works nicely when
> launching the build from within emacs. But I don't really want this to
> go in the buildfile I ship with my distributable.
>
> So what I would like is the ability to specify properties
> in some file on a per project basis, where I can stick all of this
> stuff. Preferably I would like to be able to still override these
> properties with command line parameters (so I can switch between
> jikes, and javac easily for instance).
>
> Is it possible to do this at the moment?
>
> Phil
>