Hi  Gary,
I tested you approach and it works and does what I needed.
In master build file I include for all targets following:
        <property name="tmp" value="${base_dir}\\build.inc"/>
        <include buildfile="${project::get-base-directory()}\build.inc"
unless="${file::exists(property::get-value('tmp'))}"/>
        <include buildfile="${tmp}"
if="${file::exists(property::get-value('tmp'))}"/>      
So I can put build.inc into my local directory if it differs from master
build.
Thanks for the idea.
Boni
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gary Feldman
Sent: Montag, 7. August 2006 13:57
To: nant-users@lists.sourceforge.net
Subject: Re: [NAnt-users] How to overload targets

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


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to