jenkins the definitive guide

(Jeff_L) #1

You may also want to install the MSTest plugin^15 and the NUnit plugin^16 , to display your test results.


Once you have installed the .NET plugins and restarted Jenkins, you need to configure your .NET build
tools. Go to the Configure System page and specify the path of the MSBuild executable (see Figure 5.54,
“Configuring .NET build tools in Jenkins”).


Figure 5.54. Configuring .NET build tools in Jenkins


Once you have this set up, you can return to your freestyle project and add your .NET build step
configuration.


Go to the Build section and choose “Build a Visual project or solution using MSBuild” option in the
Add Build Step menu. Then enter the path to your MSBuild build script (a .proj or .sln file), along
with any command-line options your build requires (see Figure 5.55, “A build step using MSBuild”).


Figure 5.55. A build step using MSBuild


5.10.4. Building Projects with NAnt


Another way to build your .NET projects is to use NAnt. NAnt is a .NET version of the Ant build
scripting tool widely used in the Java world. NAnt build scripts are XML files (typically with a .build
extension), with a very similar format to Ant build scripts.


To build with NAnt in Jenkins, you need to install the Jenkins NAnt plugin^17. Once you have installed
the plugin and restarted Jenkins, go to the Configure System page and specify the NAnt installation
directory in the Nant Builders section (see Figure 5.54, “Configuring .NET build tools in Jenkins”).


(^15) http://wiki.jenkins-ci.org//display/HUDSON/MSTest+Plugin
(^16) http://wiki.jenkins-ci.org//display/HUDSON/NUnit+Plugin
(^17) http://wiki.jenkins-ci.org/display/HUDSON/NAnt+Plugin

Free download pdf