Boosting Development Efficiency with CppDepend and TeamCity Integration

Installing CppDepend on the build server

To be able to run CppDepend analysis during a build on a TeamCity server you need to install CppDepend on the server which hosts the TeamCity agent that will run the CppDepend analysis. Just unzip CppDepend in a folder that the TeamCity agent can use. In our example we will use “C:\Program Files\_Tools\Development\cppdepend”.

Configuring TeamCity

  • First step: Create a CppDepend project (.cdproj)
  • Once you have created your CppDepend project you must execute a command line to generate CppDependOut directory which contains CppDepend report files:

    • Go to Projects tab and choose your project
    • Click on “edit project settings”, you will see your build configurations.
teamcity tab
  • Click on build
  • Click on build steps
  • In the build steps you can add a build step (Add build Step) and choose Command line in build runner type
  • In the option Run choose Executable with parameters
build steps
  • In the "Command executable" specify the path of your CppDepend console.
  • In the "Command parameters" specify the path of your CppDepend project (.cdproj)
run build

Save the configuration and run build.

Go to top

Setting up the CppDepend Report in the TeamCity Dashboard

To publish CppDepend HTML report:

  • Go to the Projects tab and choose your project
  • Click on “edit project settings”
  • Click on Report tabs
  • In the build report tabs click on "Create new build report tab"
build report tabs

Write the name of your report tab, specify the start page of your CppDepend report and click on Save.

report tab settings
  • Go to Projects tab and choose your project
  • Click on your last build
teamcity tabs
  • Click on "Edit Configuration Settings"
  • Under the "Artifact paths" specify the path of CppDepend out directory which contains the CppDepend Report
artifact paths
  • Save the configuration and run build once. The Report will be generated.
  • Go to your last build and click on artifact tab; you can see now a tab that contains your html report
artifacts

Go to top

CppDepend offers a wide range of features. It is often described as a Swiss Army Knife for C and C++ developers.

Start Free Trial