Bonio Lopez wrote:
> Dear all,
> ...
> Supposed I have Y project, to be build. Y-1 of them are build using ms_build
> and one using my_own.exe
> clean, rebuild, register ... also differs a bit for some of projects. For
> example, register should register a help collection for help project, and
> assembly using regasm by .NET project und COM object by COM project.
>
> So I need in the build file of a particular project an ability to overload
> some targets, to be different from the master file.
>   
In the past, I've used two strategies to do this:

1.  Check for a local build file in the project directory.  If it 
exists, use the <nant> task to execute the build target in that file, 
otherwise execute the build target in the master file.
2.  Import (using the <include> task) all of the local project build 
files, if they exist.  Then, for each project named "project.name" do

       <call target="${project.name}-build-setup" 
if="${target::exists(project.name + '-build-setup')}" />
       <call target="${project.name}-build-local" 
if="${target::exists(project.name + '-build-local')}" />
       <call target="${project.name}-build-local" 
unless="${target::exists(project.name + '-build-local')}" />
       <call target="${project.name}-build-cleanup" 
if="${target::exists(project.name + '-build-cleanup')}" />

The first is a bit more efficient overall, while the second allows for 
finer-grained control, more like an aspect-oriented approach instead of 
just object-oriented.

Gary



-------------------------------------------------------------------------
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