我有许多项目,我创建了一个通用的MSBuild文件来运行。我试图将PVS的静态分析集成到构建中,而不需要第二次构建。我跟踪了PVS网站上的一些文档,但我肯定遗漏了什么。我这么说是因为当我构建PVS时,我似乎没有触发/调用PVS。有没有人在这方面有经验,能帮我一把吗?
这里是我的构建文件的PVS位。
<UsingTask TaskName="ProgramVerificationSystems.PVSStudio.PVSStudio"
AssemblyFile="C:\Program Files (x86)\PVS-Studio\PVS-Studio-MSBuild.dll" />
<Target Name="PVSStudioAnalysisBeforeCompile" BeforeTargets="ClCompile">
<Exec Command="echo PVSStudio initiating now."/>
<PVSStudio Condition="'%(ClCompile.ExcludedFromBuild)'!='true'"
Sources="@(ClCompile)"
BeforeClCompile="true"
BuildingInIDE="false"
TrackerLogDirectory="%(ClCompile.TrackerLogDirectory)"
PreprocessorPath="$(VCInstallDir)"
Platform="$(Platform)"
ProjectFullPath="$(MSBuildProjectFullPath)"
SolutionDir="$(SolutionDir)">
<Output TaskParameter="SourcesAfterTlogParsing"
ItemName="CLCompileAfterTlogParsing" />
</PVSStudio>
</Target>
<Target Name="PVSStudioAnalysisAfterCompile" AfterTargets="ClCompile">
<PVSStudio Sources="@(CLCompileAfterTlogParsing)"
BeforeClCompile="false"
BuildingInIDE="$(BuildingInsideVisualStudio)"
PreprocessorPath="$(VCInstallDir)"
OutputFilePath ="$(OutputDir)"
Platform="$(Platform)"
ProjectFullPath="$(MSBuildProjectFullPath)"
SolutionDir="$(SolutionDir)" />
<Exec Command="echo PVSStudio finished"/>我相信你们都需要一些更多的信息来解决这个问题,所以让我知道我应该为你得到什么。
谢谢,
TBG
发布于 2014-09-15 11:40:16
您应该执行以下操作之一:
BuildingInIDE属性设置为false,还应指定要保存到OutputFilePath = "$(OutputDir)"/pvs.log的输出文件。您可以通过以unparsed log的形式打开PVS插件/独立插件来查看这样的日志。Visual Studio和PVS-Studio插件中构建您的项目,以便立即将分析器结果连接到它的输出窗口,则应该将两个BuildingInIDE属性设置为true (或"$(BuildingInsideVisualStudio)"),并通过进入PVS-Studio -> Options -> Specific Analyzer Settings -> MSBuild Output Log Monitoring并将其设置为true来启用MSBuild模式。https://stackoverflow.com/questions/24938183
复制相似问题