Integrate CppDepend with Hudson
Installing CppDepend on the build server
To be able to run CppDepend analysis during a build on a Hudson server you need to install CppDepend on the server which hosts the Hudson agent that will run the CppDepend analysis. Just unzip CppDepend in a folder that the Hudson agent can use. In our example we will use “C:\Program Files\_Tools\Development\cppdepend”.
- First step: Create a CppDepend project (.cdproj) once you have your CppDepend project you must execute a windows batch command to generate CppDependOut directory which contains CppDepend report files:
- Go to Hudson Dashboard
- Click on your Hudson job
- Click on "Configure option" for your Hudson job
- In the build portion add a build step (“execute windows batch command”)
- Specify the execution command (path of CppDepend console and the path of your CppDepend Project (.cdproj))
Setting up the CppDepend Report in the Hudson Dashboard
To publish the CppDepend HTML report you must install HTML publisher plugin:
- Go to Hudson Dashboard
- Click on "Manage Hudson"
- On the Plugin Manager page, go to the "Available" tab next to Updates tab and click on recommended.
- In the build report tabs click on "Create new build report tab"
- Look for the html publisher plugin, enable the checkbox and click install. Just Wait for the "Success" Status.
Restart Hudson by clicking on the provided link on the success page. if you are using Tomcat, execute
/bin/shutdown.sh and /bin/startup.sh
Html Publisher plugin is useful to publish the html reports that your build generates to the job and build pages. Below are the steps to publish and archive the HTML report files
- Click on the Configure option for your Hudson job
- In the post build portion, look for the Publish HTML Reports option and enable the checkbox.
- Fill the path to the out directory of CppDepend containing the html report in the "HTML directory to archive" field. Specify the pages to display (default CppDependReport.html); you can specify multiple comma-separated pages and each will be a tab on the report page. Finally, give a name in the Report Title field, which will be used to provide a link to the report. By default, only the most recent HTML report will be saved, but if you'd like to be able to view HTML reports for each past build, select "Keep past HTML reports."
- Save the configuration, and run build once. The published HTML reports are available to view from within Hudson with convenient links in the dashboard.