Geddon
Geddon

Reputation: 1306

How to get CruiseContol.NET project name from NAnt?

Is there a method where I can echo the ccnet project name that executed the NAnt build file within that build file itself? Does my build know what cruise project invoked it?

Upvotes: 1

Views: 94

Answers (2)

Adam Bruss
Adam Bruss

Reputation: 1674

The ccnet project name is auto passed to Nant as

CCNetProject

So in Nant you would do

<echo message="The ccnet project name is ${CCNetProject}"/>

See here for all the integration parameters passed from ccnet to Nant.

http://cruisecontrolnet.org/projects/ccnet/wiki/Integration_Properties

Upvotes: 1

otaku
otaku

Reputation: 964

In the ccnet.config file you would do something like this:

<nant>
    <buildFile>myScript.build</buildFile>
    <buildArgs>-D:ccnetProject="$(ccnetProject)"</buildArgs>
</nant>

You can access the variable in the build script via ${ccnetProject}. More info can be found here.

Upvotes: 1

Related Questions