views:

33

answers:

2

Hi, I would like to have a nant task which builds code into either a dev/test folder depending on the type of build. Rather than have repeated tasks/targets with just different folders I would like to call Nant task from CruiseControl.NET with a different parameter dev / test.

The nant task would then define a property for the output folder depending on the input parameter. I think I needs some kind of 'if' statement to test the parameter and define the correct one.

Any ideas how to do this? Thanks.

+1  A: 

What version of CCNet are you using?

Version 1.5 has the ability to pass parameters down to NAnt and seems to work quite well.

Take a look here for more info.

DilbertDave
A: 

Typing:

nant -help

shows that you can define properties as follows:

-D:name=value

to test it in a script:

if="${property:exists('name')}"

in CCNet, you can run it with:

<tasks>
 <nant>
  <executable>nant.exe</executable>
  <buildFile>script.build</buildFile>
  <targetList>
   <target>build</target>
  </targetList>
  <buildArgs>-D:defaultPath=C:\build</buildArgs>
  <buildTimeoutSeconds>600</buildTimeoutSeconds>
 </nant>
</tasks>
jcmeyrignac