ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: <ant/> properties
Date Thu, 12 Aug 2004 09:23:06 GMT
On Wed, 11 Aug 2004, sebastian ssmoller <sebastian.ssmoller@gmx.net>
wrote:

> passing properties to the new project using this code snippet 
> 
> <ant ...>
> 	<property file="local.properties"/>
> </ant>
> 
> all these properties in the "local.properties" are evaluated in the
> context of the new project right?  

Yes.  Technically the property elements are <property> tasks run
inside the new project.

> so a property like "deploy=${basedir}/deploy" in the
> local.properties will be set relative to the basedir to the new
> project rather than to the old one - correct ?

It depends the values of the dir and inheritall attributes of your
<ant> task - see the table in <ant>'s manual page.  Technically it is
the basedir of the new project, but that may be different from the
<project> element's basedir attribute.

> and if i want to behave <ant/> the other way round (deploy relative
> to the basedir of the calling project) i have to add all these
> properties manually like this:

Or set the dir attribute of the <ant> task.

> did i miss something ?

Yes.

You can load the properties file in your main build file, give them a
common prefix (or make them identifiable in any other way) and use a
<propertyset> to pass them down to your subbuild.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message