ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Douglass <>
Subject Re: local properties
Date Mon, 30 Oct 2000 17:52:42 GMT
At 05:23 PM 10/30/2000 +0100, Stefan Bodewig wrote:
>  MD> For example, is it a bug or is it intentional that the basedir
>  MD> property always refers to the directory containing the top level
>  MD> build file?
>I thought basedir would be the one and only exception to the rule that
>parent project's properties are carved into stone. In Ant 1.2
>${basedir} will always expand to the "current" project's basedir, at
>least it does for me.

In my top-level file I had something like

   <target name="bld.uslcapp" depends="rpi.sss.usapplet.depends">
     <ant antfile="${user.dir}/bld/rpiusage/uslcapp/build.xml" 
target="build" />

The top level build.xml is something like x:\dev\bld\build.xml. I cd to 
x:\dev and do
   ant -buildfile=bld/build.xml bld.uslcapp
and everywhere basedir is x:\dev\bld. About a dozen targets get executed 
all with their own build files and all get the same basedir of "x:\dev\bld"
The debug output shows it being set many times per project.

I reread the <ant ...> description and tried adding the dir attribute, as in

   <target name="bld.uslcapp" depends="rpi.sss.usapplet.depends">
     <ant antfile="${user.dir}/bld/rpiusage/uslcapp/build.xml"
          dir="${user.dir}/bld/rpiusage/uslcapp" target="build" />

and now I see that basedir for the uslcapp/build.xml is indeed the 
directory it resides in. So I guess that the dir attribute is really the 
basedir property in disguise. It seems to me that there is no option but to 
set the dir attribute for all the sub-projects. Ideally, not setting it 
would mean the basedir project was set from the basedir attribute in the 
<project ...>

Mike Douglass
Senior Systems Programmer	
Server Support Services	518 276 6780(voice) 2809 (fax)
Rensselaer Polytechnic Institute 110 8th Street, Troy, NY 12180

View raw message