Upgrading MSBuild project from NCover 2.0 to 3.0

Upgrading MSBuild project from NCover 2.0 to 3.0

Hi,

In my MsBuild project, I had

<UsingTask TaskName="NCoverExplorer.MSBuildTasks.NCoverExplorer" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCoverExplorer.MSBuildTasks.dll"/> <UsingTask TaskName="NCoverExplorer.MSBuildTasks.NCover" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCoverExplorer.MSBuildTasks.dll"/>

According to the documentation, I now have to change this to

<UsingTask TaskName="NCover.MSBuildTasks.NCoverReporting" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll"/>

Because AFAIK both tools were merged together.

But then I had this target which is not clear how to map to the new (3.0) format:

<Target Name="CodeCoverage">

<!-- Find all Resource assemblies --> <RegexMatch Input="@(CodeAssemblies)" Expression="(Company.Project.Resources).*[.]dll$"> <Output TaskParameter="Output" ItemName="ResourceAssemblies"/> </RegexMatch>

<!-- Filter out the Resource assemblies from the coverage analysis --> <CreateItem Include="@(CodeAssemblies)" Exclude="@(ResourceAssemblies)"> <Output TaskParameter="Include" ItemName="CodeCoverageAssemblies"/> </CreateItem>

<!-- Remove the old coverage files for the projects being analysed --> <Delete Files="@(TestAssemblies->'%(FullPath).$(NCoverFile)')"/>

<NCover ToolPath="$(NCoverPath)" CommandLineExe="$(NUnitCmd)" CommandLineArgs="$(DOUBLE_QUOTES)%(TestAssemblies.FullPath)$(DOUBLE_QUOTES) /nologo" CoverageFile="%(TestAssemblies.FullPath).$(NCoverFile)" LogLevel="Normal" LogFile="%(TestAssemblies.FullPath).$(NCoverLogFile)" WorkingDirectory="%(TestAssemblies.RootDir)%(TestAssemblies.Directory)" ExcludeAttributes="" RegisterProfiler="false" Assemblies="@(CodeCoverageAssemblies)" ContinueOnError="true"/>

<!-- Create Item collection of all the coverage results --> <CreateItem Include="%(TestAssemblies.FullPath).$(NCoverFile)"> <Output TaskParameter="Include" ItemName="NCoverResults"/> </CreateItem>

<!-- Merge all the coverage results into a single summary Coverage file --> <NCoverExplorer ToolPath="$(NCoverExplorerPath)" ProjectName="$(MSBuildProjectName)" OutputDir="$(Temp)" Exclusions="$(CoverageExclusions)" CoverageFiles="@(NCoverResults)" SatisfactoryCoverage="70" ReportType="ModuleClassSummary" HtmlReportName="$(CodeMetricsFolder)\$(NCoverHtmlReport)" XmlReportName="$(CodeMetricsFolder)\$(NCoverSummaryFile)" FailMinimum="False"/>

<!-- Create a full report with code highlighting --> <CreateItem Include="$(CodeMetricsFolder)\FullCoverageReport***.html"> <Output TaskParameter="Include" ItemName="ExistingCoverageHTMLFiles"/> </CreateItem> <Delete Files="@(ExistingCoverageHTMLFiles)"/> <NCoverExplorer ToolPath="$(NCoverExplorerPath)" ProjectName="$(MSBuildProjectName)" OutputDir="$(Temp)" Exclusions="$(CoverageExclusions)" CoverageFiles="@(NCoverResults)" SatisfactoryCoverage="70" ReportType="FullCoverageReport" HtmlReportName="$(CodeMetricsFolder)\FullCoverageReport\" FailMinimum="False"/> </Target>

Thanks for you help.


RE: Upgrading MSBuild project from NCover 2.0 to 3.0

we have some pre-release documentation floating around that covers converting an < NCoverExplorer / > task to an < NCoverReporting / > task. I'll search it out and send it to you.