ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: ${basedir} prepended to properties?
Date Tue, 11 Mar 2003 00:34:02 GMT
On Tue, 11 Mar 2003 11:11 am, Dwayne Schultz wrote:
> I am writing a myproj_build.xml file that will go in a jar to help
> users use our product.  Someone started putting ${basedir} in front of
> some of the properties but I think it is unnecessary.  We have
> something like this:
>
> 	<property name="deploymentFile" value="${basedir}/conf/colle.cds"/>
>
> It works on my system if I just remove the ${basedir}.  Can anyone
> comment on this?
>

It depends on what you want deploymentFile to contain and how you use the 
property. 

Using ${basedir} is not necessary. If you are passing the property value into 
Ant tasks that expect a File, it will be resolved against the basedir 
automatically. "Resolving" is slightly more sophisticated than prepending 
${basedir} since it will handle cases where the value is an absolute path , 
etc.

In some cases you want to fix the value of the property to the full path. You 
may be passing the property to a sub-build with a different basedir, for 
example. In that case you should use the form

<property name="deploymentFile" location="conf/colle.cds"/>

This will perform the resolution at the time the property is created. Check 
out the <property> task documentation.

Conor


Mime
View raw message