This is pretty easy to accomplish by iterating a fileset created using
**/*.build to list all the build files in your sub-directory structure and
then execute the <nant> task on each one with the necessary parameters.

 

It does however sound a bit dangerous unless all your assemblies are (and
always will be) totally independent of each other, because you will have
little or no control over the order in which the build scripts are
executed.  In my experience, I have always found it simpler to manually
edit the master build script to make sure all components are built in the
correct order, and use the correct references.  The nested build scripts
for each component are then template based so adding a new component is
just a case of taking a copy of the template, tweaking the assembly
specific properties, and sdding a call in the correct place in the master
build script.

 

HTH,

 

Bill

 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 21 February 2008 15:14
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Walking directory trees for .build files ...

 

I am looking for a technique using Nant to create a 'generic' directory
walking .build file. 

For example:  In the following scenario, I have three project directories,
each with a .build file (Project1, Project2 & Project3).  I'd like to
create a .build file one level up, in this case, Projects.build, that will
iterate over each sub-directory and execute the three .build files feeding
each with the same command line target information as the top level build
file.

I would much prefer to create this top level .build script in a generic
manner so that as new projects are added, and subordinate .build files
become available, the top level .build file will 'discover' the new files
and automatically include it in the build-thus alleviating the need to
constantly have to maintain Projects.build as projects are added or
deleted.

Projects
            Projects.build
            Project1
                        Project1.build
            Project2
                        Project2.build
            Project3
                        Project3.build 



This seems like a fairly common scenario for managing a hierarchy of
project directories.  The idea is to make any one directory the current
directory, execute Nant from that point and have all .build scripts in the
next level down executed.  If it works right, the Projects.build script
would be recursive and could be copied to any directory so as to
automatically 'walk' the next level down. 



Before I try to figure out this myself, I wanted to see if someone else
had already solved this problem? 



Thank you.

Ken Parrish
Gomez, Inc.

 


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

 


IMPORTANT 
The information contained in this e-mail and any attachments is intended for 
the addressee only
and may contain legally privileged or confidential information. If you are not 
the intended
recipient you must not use, disclose, copy, distribute, alter, or take any 
action in reliance
on the information and Avon Insurance plc will not accept liability for any 
loss or damage howsoever
arising, directly or indirectly in reliance on it and gives no warranty or 
representation as to its
accuracy or reliability. If you are not the addressee, please notify us 
immediately on 01789 202121*
and delete the material from your computer and destroy any copies.

Avon Insurance plc reserves the right to monitor and record incoming and 
outgoing email messages for
the purposes of investigating or detecting unauthorised use of its system and 
ensuring its effective operation.
Avon Insurance plc will not accept liability for any loss or damage as a result 
of any virus being passed on.

Avon Insurance plc (No. 209606). 
Registered in England. Registered Office: Arden Street, Stratford upon Avon, 
Warwickshire CV37 6WA.
Authorised and regulated by the Financial Services Authority.
A member of the NFU Mutual group of companies and the Association of British 
Insurers.

*For security and training purposes, telephone calls may be recorded and 
monitored.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to