【问题标题】:Integrate PVS-Studio into MSBuild file将 PVS-Studio 集成到 MSBuild 文件中
【发布时间】:2014-07-24 15:40:33
【问题描述】:

我有许多项目,我创建了一个通用的 MSBuild 文件来运行。我正在尝试将 PVS Studio 的静态分析集成到构建中,而无需再次构建。我遵循了 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"/>

我相信你们都需要更多信息来解决这个问题,所以让我知道我应该为你们准备什么。

谢谢,

待定

【问题讨论】:

    标签: c++ c msbuild pvs-studio


    【解决方案1】:

    您应该执行以下操作之一:

      1234563 ,OutputFilePath = "$(OutputDir)"/pvs.log。 您将能够从 PVS-Studio IDE 插件/独立中查看此类日志,只需将其打开为 unparsed log。 1234563 (或"$(BuildingInsideVisualStudio)")并通过转到PVS-Studio -&gt; Options -&gt; Specific Analyzer Settings -&gt; MSBuild Output Log Monitoring并将其设置为true来启用MSBuild模式。

    【讨论】:

      猜你喜欢
      • 2019-03-21
      • 1970-01-01
      • 2018-02-18
      • 1970-01-01
      • 1970-01-01
      • 2018-02-09
      • 2020-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多