Even tho the working directory does not do what you expect, <nant> does
resolve relative paths/files to the directory of the child project. This is
so all you need to do is make things relative to the build file and NAnt
does the rest. If this is not the behavior you are seeing you may want to
post your build files.

Take a look at examples and the individual sample build files. They show how
to use a simple master/child build relationship in separate directories. All
the file refs are relative to the child build file.

If you really need the working directory set you can use <exec> with the
workingdir attribute to run nant against your build files.

----- Original Message -----
From: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 04, 2003 1:41 AM
Subject: [Nant-users] <nant> task question


> Hi!
>
> I'm using NAnt 0.8.1.
>
> Is it possible to execute <nant> task so that the working directory for
> sub-build would be
> temporarily set to the directory where sub.build file is found?
>
> Ideally the usage would be:
>
> <nant buildfile="path_fo_file.build" setworkingdir="true" target="..." />
>
> which would:
>
> 1. Save current working directory
> 2. Change the working directory to a directory where "path_to_file.build"
is
> located
> 3. Invoke sub-build
> 4. Revert to saved working directory.
>
> This would allow both the master build file and child build files to
contain
> only relative
> path names while allowing them to be built separately.
>
> I cannot find a way to implement this functionality with current NAnt. I'm
> not sure, but looking at src/NAnt.Core/Tasks/NAntTask.cs this looks like a
> small change that would optionally save and restore working directory
around
> "project.Run()" call at the bottom of the file.
>
> Regards,
>
> Jarek



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to