My test folder is set up as follows:
I have ran source monitor on its own from the command line and it runs to completion successfully and outputs some .xml files that I need for my CI process.
Below is my .proj file that I am trying to run:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Analyze" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildCommunityTasksPath>.</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="MSBuild.Community.Tasks.Targets"/>
<Target Name="Analyze">
<Exec Command="sm.exe /C sm-commands.xml"/>
<XmlRead XPath="//*/metric[@id='M0']" XmlFileName="sm-summary.xml">
<Output TaskParameter="Value" PropertyName="NumberOfLines" />
</XmlRead>
<TeamCityReportStatsValue Key="NumberOfLines" Value="$(NumberOfLines)" />
<XmlRead XPath="//*/metric[@id='M5']" XmlFileName="sm-summary.xml">
<Output TaskParameter="Value" PropertyName="MethodsPerClass" />
</XmlRead>
<TeamCityReportStatsValue Key="MethodsPerClass" Value="$(MethodsPerClass)" />
<XmlRead XPath="//*/metric[@id='M7']" XmlFileName="sm-summary.xml">
<Output TaskParameter="Value" PropertyName="StatementsPerMethod" />
</XmlRead>
<TeamCityReportStatsValue Key="StatementsPerMethod" Value="$(StatementsPerMethod)" />
<XmlRead XPath="//*/metric[@id='M10']" XmlFileName="sm-summary.xml">
<Output TaskParameter="Value" PropertyName="MaxComplexity" />
</XmlRead>
<TeamCityReportStatsValue Key="MaxComplexity" Value="$(MaxComplexity)" />
<XmlRead XPath="//*/metric[@id='M14']" XmlFileName="sm-summary.xml">
<Output TaskParameter="Value" PropertyName="AvgComplexity" />
</XmlRead>
<TeamCityReportStatsValue Key="AvgComplexity" Value="$(AvgComplexity)" />
</Target>
</Project>
I get the following error:
RESEARCH LINK:Article I am following