I have 4 files: one in the root folder, three in a subfolder.
 
In the root folder there is the main build file which includes one of the files in the subfolder. This other file includes another two. Thus:
 
Main file has <include buildfile="inc/included.build" />
 
inc/included.build has:
 
<include buildfile="task1.build" />
<include buildfile="task2.build" />
 
According to an email I found (http://www.geocrawler.com/archives/3/14603/2002/9/0/9638108/the correct behavior for <include> is to set the included file's basedir to the basedir of the file including it.
 
This is pretty inconvenient, as the included file cannot include other files relative to it, that is, you cannot create complex libraries, as the library file including other files would have to know its position relative to the file that included it. This is pretty counter-intuitive.
 
Anyway, even if I go with the fact that the basedir is set in such a way, the output of the above setup is very interesting:
 
NAnt version 0.8.4.0 Copyright (C) 2001-2003 Gerry Shaw
http://nant.sourceforge.net
 
Buildfile: file:///C:/default.build
     [echo] Including file included.build
     [echo] Master include included.
     [echo] Including file task1
     [echo] task1 included
     [echo] Including file task2
 
BUILD FAILED
 
C:\inc\included.build(7,3):
Could not include build file C:\task2.build.
 Could not find file "C:\task2.build".
 
Total time: 0.1 seconds.
 
 
The file 'included.build' successfully includes the first file (task1), but fails to include the second one, although they are both specified relative to it.
 
If you will be fixing this issue, I vote that <include> task keeps it's base relative to the file itself, so that the above described scenario works correctly. For the rest of targets, I guess it is more convenient to inherit the basedir of the including file.
 
 
Damir
 
p.s. I used v0.8.4.31128.

Attachment: include.zip
Description: Zip compressed data

Reply via email to