Shaw, Gerry wrote:

>Attached is an example project that simulates a project with 2 libraries
>with 2 examples.  From inspection you can see how this design would scale
>well to a much larger example.  This is the basis for the design.
>
>The key to this design is the a modified <include> task.  The modification
>does two things:
>
>1. It removes the build exception if you do a recursive include and simply
>ignores it without doing the include (something like an include once).
>  
>
Thats a good idea. Much nicer. Kind of like a header include guard in C.

>2. When tasks are executed in the included build files the base directory
>changes to be where the build file is located.  So if you have a <csc> task
>in an included build file the path to the source files should be relative to
>the build file.  Currently the path needs to be relative to the  buildfile
>doing the including.
>  
>
Can we take a poll on what peoples feelings are on this. My initial idea 
for the include task was that it pull in an included file as if that 
included file was part of the main file ( ie keeping the same base 
directory ). and that for recursive builds you'd use the <nant> task to 
call child builds and they would have basedir the same as that child 
build file. I'm not sure which is the best way which is why I want to 
see what other people think.

with the new way you could do:
<!-- included file in c:\foo -->
 <property name="somepath" value="."/>
    ...
    ...
    <target name="included" >
    <csc target="library" debug="true" output="./bin/somelib.dll">
            <sources basedir="${somepath}">
                <includes name="*.cs"/>
            </sources>
    </csc>
    </target>
</project>

main build file in c:\bar -->
<?xml version="1.0"?>
<project name="foo" default="test">
...
    <call target="included"/>
    <csc target="library" debug="true" output="./bin/someotherlib.dll">
            <sources basedir="${somepath}">
                <includes name="*.cs"/>
            </sources>
    </csc>
...
</project>.

and the included target will execute in the same basedir as the included 
file and ${somepath} will expand to c:\foo. However the property that 
gets pulled in "somepath" will be expanded in the context of the main 
build file ( to c:\bar ). This could lead to some unexpected behaviour 
and cause some hard to track down bugs. Its a contrived example  I know. 
I just want to make sure we get this right.

I agree with Gerry that we should get this right and make that the only 
way and not have an option for it. That would just make it even more 
confusing.

Ian

>  
>




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to