We do something similar except our master build file explicitly calls
the sub build files in the correct order.  There is some elegance to the
idea of adding a subproject without having to modify an existing build
file.  That doesn't work for us, and it doesn't work in general when you
have cross-subproject dependencies.

Our directory layout is not quite as hierachical as the example (there
is only one level of directories for subprojects).  From the top level
source directory, there are several subdirectories--one for each
assembly.  At first we were using the foreach technique shown in your
example except that the subdirectories actually need to be processed in
non-alphabetic order.  Say we have subprojects A, B, and C.  Because A
and C both reference the class library being built in B, we have to
build B first and then A and C.

The only way we've come up with to do that is for the master build file
to directly <nant> into B, then A and C.  

What would be nice is if there was some way of this being automatically
determined.  It is theoretically possible for some algorithm to notice
the fact that the <csc> task in A's project has a <references> to the
file created as output in the <csc> task of B.

Anyway, it's not a huge issue for us right now.  For now we have half a
dozen assemblies with simple dependencies.  However, we're just one
small development team in the company.  Currently the company has 100+
COM DLLs.  If someday we migrate our applications to .NET and look at
NAnt, the dependencies of those 100+ assemblies (assuming we don't
combine a lot more than we do now) will be a bit difficult to manage by
hand.

Even if we can't find an elegant solution where NAnt figures it out
itself, I have though about writing an app that traverses all of our
slave build files and building a dependency map that could be used to
generate a correct build order for a master build file to read from a
file.

Anyway, enough of my pipe dreams...

-----Original Message-----
From: Giuseppe Greco [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 5:54 PM
To: Jaroslaw Kowalski; NAnt Developers
Cc: NAnt Users

Jaroslaw,

First of all, thank you for your feedback! I've really appreciated it.

On Fri, 2003-06-27 at 23:55, Jaroslaw Kowalski wrote:
> I think it's a good idea to promote good build system design and I
think
> that your document is a step in the right direction.
> 
> I like the idea of being able to treat all subprojects in a generic
way. You
> use gateway build files for that purpose, but I think that this kind
of
> functionality should be directly supported with NAnt, so you don't
need to
> resort to this kind of hack.
> 
> I think, one should be able to invoke <nant> like this (or with some
other
> syntax):
> 
> <nant target="${target}">
>     <buildfiles>
>         <includes ... />
>     </buildfiles>
> </nant>
> 

This would be nice... but it is not implemented yet.

The main advantage of gateway build files, is that you can add
new subprojects without having to modify any build file.

> This can be even used with recently added "named filesets" feature.
You
> would define a (single) fileset that would keep all your *.build files
and
> invoke various targets on it using simple one-liner without the need
of a
> gateway file trick.
> 
> I don't remember the exact syntax for named filesets, but the concept
is:
> 
> <fileset id="childrenBuildFiles">
>     <includes file="**/*.build" />
> </fileset>
> 
> <target name="build">
>     <nant target="build" fileset="childrenBuildFiles" />
> </target>
> 

Yes, the syntax is correct. I'll introduce an example ASAP -- fileset
references are available since last Tuesday...

> This would make your *.build files MUCH more readable, and simplicity
and
> readability is (imho) the most iportant part of a build system.
> 
> What do you think?

I think we could discuss all together how to continue the development
of this document; as soon as I'll publish the DocBook source files,
anybody will be able to enhance it...

Gius_.

> 
> Jarek
> ----- Original Message -----
> From: "Giuseppe Greco" <[EMAIL PROTECTED]>
> To: "NAnt Developers" <[EMAIL PROTECTED]>; "NAnt
Users"
> <[EMAIL PROTECTED]>
> Sent: Friday, June 27, 2003 10:29 PM
> Subject: [nant-dev] Building Projects With NAnt
> 
> 
> > Hi all,
> >
> > Since I've decided to adopt NAnt as the standard build
> > tool here at ::agamura::, I've written a document titled
> > "Building Projects With NAnt"...
> >
> > It is available at http://developer.agamura.com/technotes
> > either in PDF or HTML format -- DocBook source files will
> > be available soon.
> >
> > May be it could be helpful for those who are new to NAnt...
> > It covers NAnt basics and introduces how projects should
> > be structured.
> >
> > Any comment, suggestion, or critic is welcome!
> >
> > Gius_.
> >
> > --
> > ----------------------------------------
> > Giuseppe Greco
> >
> > ::agamura::
> >
> > phone:  +41 (0)91 604 67 65
> > mobile: +41 (0)76 390 60 32
> > email:  [EMAIL PROTECTED]
> > web:    www.agamura.com
> > ----------------------------------------
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email sponsored by: Free pre-built ASP.NET sites
including
> > Data Reports, E-commerce, Portals, and Forums are available now.
> > Download today and enter to win an XBOX or Visual Studio .NET.
> >
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> > _______________________________________________
> > nant-developers mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/nant-developers
> >
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
>
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> _______________________________________________
> Nant-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-users
-- 
----------------------------------------
Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  [EMAIL PROTECTED]
web:    www.agamura.com
----------------------------------------



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to