> Hi All,
> I have two build files
> one which I will execute with nant
> <project ......>
>                 <target name= “def”>
>                                 <nant buildfile=”second.build”/>
>                 </target>
> 
>                 <target name=”copysmt”>
>                 </target>
> 
> </project>
> 
>  second nested ”second.build”
> 
>  <project ......>
>                 <target name= “def”>
>                                 <call target=”copysmt”/>
>                 </target>
> </project>
> 
>  Nant will end with en error, that Target ' copysmt ' does not exist in
> this project.
> I does not help, when I will try to give same name to projects in both
> build files.
> How can I do that.
> Do I need use include task and then call instead of nant task to
> execute this scenario?
> Thx for your help.

The nant task runs another build file it is sort of like a function call. It is 
going to run the default target in that build file and exit. You can specify 
that it run the "copysmt" target if you want on the nant task:

<nant buildfile="second.build" target="copysmt" />

This will execute the "copysmt" target in that build file. That build file will 
have access to all the properties of the calling nant script. However, once it 
is done it is unloaded.

Using include basically inserts the contents of the build script right inline 
into your current build script. You can use this perhaps to include scripts 
that have common targets in them shared by many builds. 

Or, the opposite, which I do to include environment specific stuff. We have a 
build script for our project and I have a settings.xml build file which I 
include at the top of the project.build file. The settings file sets properties 
such as the framework target version, the path to deploy to, etc. We edit the 
settings.xml file when we branch without needing to modify the primary build 
file.

So, either one will work, depending on your needs.

Hth,
BOb

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to