ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <sbaill...@imediation.com>
Subject RE: setting properties on a per user, per project basis
Date Wed, 14 Feb 2001 19:49:03 GMT

Yes, you can specify a file properties. For example:

<project name="myproject">
	<property file="${user.home}/user.properties"/>
	...
	// default global properties
</project>

The setted properties will be the first one found using the following order:

1) command line properties
2) user properties in file
3) global default properties

Hope it helps.

-- 
 St├ęphane Bailliez 
 Software Engineer, Paris - France 
 iMediation - http://www.imediation.com 
 Disclaimer: All the opinions expressed above are mine and not those from my
company. 



> -----Original Message-----
> From: Phillip Lord [mailto:p.lord@hgmp.mrc.ac.uk]
> Sent: Wednesday, February 14, 2001 4:45 PM
> To: ant-user@jakarta.apache.org
> 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....
> 
> 
> ant -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
> 

Mime
View raw message