I am new to TeamCity. I am setting up continuous integration process and running Code Metrics analysis step as part of this process. I am trying to calculate code metrics and display graphs (Customizing Statistics Charts) of this code metrics data over time.
In order to accomplish this task I have added a task in MSBuild to run Code Metrics analysis by running Metrics.exe. I have used the MSBuild community task XmlRead to extract the values from the xml output file generated by Metrices.exe and then the Team City task TeamCityReportStatsValue to publish these values to TeamCity Server.
However this step of publish these values to TeamCity Server is failing and the following is the error that is being logged:
[CodeMetrics] Unable to process service message: "[buildStatisticValue key='maintainabilityIndex' value='90;90;90;95;98;95;98;79;77']"
Following is the Code Metrics analysis Task from MSBuild.
<Target Name="CodeMetrics" DependsOnTargets="Compile">
<Exec Command='$(CodeMetricsTool) /plat:$(MSBuildToolsPath) /out:"$(MSBuildProjectDirectory)\Reports\CodeMetricsReport.xml"/f:"$(MSBuildProjectDirectory)\CI_Demo\bin\Release\*.dll"' />
<XmlRead XPath="//*/Metric[@Name='MaintainabilityIndex']/@Value" XmlFileName="$(MSBuildProjectDirectory)\Reports\CodeMetricsReport.xml">
<Output TaskParameter="Value" PropertyName="maintainabilityIndex" />
<TeamCityReportStatsValue Key="maintainabilityIndex" Value="$(maintainabilityIndex)" />
I would really appreciate any help resolving this issue.