Domanda

We use teamcity for

  • Builds
  • Code coverage (using the built in dotCover)
  • Code analysis (using NDepend)

This works great separately.

But I cant figure out a slick way to get the coverage report in ndepend format and the using it as input to ndepend with teamcity.

I can do it all manually using the command line tools step by step but it takes to much effort every time. I know I could do a bat / rake file and create xml configuration files for dotcover and calling the exe and the calling ndpend manually. But as said, I am looking for a more integrated and automated way.

È stato utile?

Soluzione

Concerning NDepend, in the .ndproj project file, you need to tweak the XML to reference the dotCover coverage file, it can look like:

  <CoverageFiles UncoverableAttribute="NDepend.Attributes.UncoverableByTestAttribute">
    <CoverageFile MergeMode="Or">.\CoverageFiles\CoverageFile.xml</CoverageFile>
  </CoverageFiles>

Notice that you can put several <CoverageFile> tag, you'll want to keep the MergeMode="Or". In this sample a coverage file path relative to the directory that hosts the .ndproj file is provided, but if your project file contains absolute paths you have to put the absolute file path too.

In a near future version, an API will be given to NDepend users to make easy the programmatic creation and modification of NDepend project files.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top