I'm having a strange issue with having a "master" NAnt file that calls
other NAnt files. Here's a quick summary of what I have:

./
  Project.build
    ...
    <nant buildfile="SubDir/Project.SubDir.build" />
    <exec program="build/SomeApp.exe" />
    ...

./SubDir/
  Project.SubDir.build
    <script language="C#">
      ...
      File.Open("MyFile");
      ...

MyFile is a file in SubDir. Now, if I run the NAnt script in SubDir
directly, it works fine. The C# code is able to find the file.
However, if I run the NAnt script in the base directory /, the C# code
tells me the file cannot be found. I replaced the C# code with
project.Log(Level.Info, Path.GetFullPath("."));

and it gave me the base directory instead of SubDir.

Now for the strange part. The rest of the tasks in
Project.SubDir.build execute with the correct base directory. However,
when it returns to Project.build and attemps to execute the <exec />
task, the basedir is now ./SubDir/ !

Can anyone provide any insight on this?

Thanks,

Johann MacDonagh

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to