The base directory of the project is available in NAnt how you
get at it depends on the version of NAnt for older versions (0.84) there
is a property nant.project.basedir that will have the value in it. In
0.85 this property has been depreciated in favor of the function
project::get-base-directory() to access the project base.  
        NAnt is based on Ant it's not a direct port. There Ant features
that NAnt doesn't have but there also a number of features that are
unique to NAnt. It would be a good idea to check out the manual so that
you don't get caught by the differences. In any event if you'd like to
keep scripts consistent and use a property basedir for the project base
I would add a property declaration something like the following:
<property name="basedir" value="${project::get-base-directory()} />


> -----Original Message-----
> From: Shawn Oster [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 29, 2005 2:04 PM
> To: nant-users@lists.sourceforge.net
> Subject: RE: [Nant-users] weird basedir issue (bug/bad ant
> implementation?)
> 
> 
> Oh, I didn't realize Nant only supported a subset of what Ant does.
> Basedir is one of the standard properties of the <project> element in
> Ant.  Weird, I wonder why the devs decided not to include this
standard
> functionality.
> 
> Thanks for the heads up on the missing feature!
> 
> > -----Original Message-----
> >
> > Properties are set by using the <property> tag.  You can not
> > set them from the <project> element.
> >
> > <property name="base.dir" value="c:\mydirectory" readonly="true" />
> >
> > Tony
> >
> > ________________________________
> >
> > All,
> >
> > I'm new to NAnt but definitely not new to any of the
> > Ant-derived tools and in porting an existing Ant script I've
> > come across a weird issue in NAnt.  I run the following very
> > basic script:
> >
> > <project name="myapp" basedir="." default="compile" >
> >
> >  <!-- Compile -->
> >  <target name="compile">
> >   <echo message="Basedir is ${basedir}" />
> >  </target>
> >
> > </project>
> >
> > And I get the error message:
> >
> > "Property 'basedir' has not been set."
> >
> > Which is pretty funny considering it's the very first thing I
> > do in the script.  This has worked in all the other Ant tools
> > I've used so I'm left scratching my head on this one.
> >
> > Thanks for any help.
> > Shawn
> >
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick
> _______________________________________________
> Nant-users mailing list
> Nant-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nant-users



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to