【问题标题】:Integrating Stylecop in Jenkins for .NET project在 Jenkins 中为 .NET 项目集成 Stylecop
【发布时间】:2015-08-06 12:32:20
【问题描述】:

我已经在 Windows 机器上安装了 Jenkins,它正在正确构建 .NET 代码。我在 Jenkins 中安装了 Violations 插件来验证 Style cop warnings 。在构建解决方案时,StyleCop 验证显示在 Jenkins 控制台输出页面中,如下所示

  C:\Users\\\\Properties\AssemblyInfo.cs(32,1): warning : SP2000 : StyleCopPlus.StyleCopPlus :  Invalid spacing at the end of the line. [C:\Users\\\\\Midhun.csproj]

    1660 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.35 Finished: SUCCESS

但它没有在违规页面中显示任何内容。

我在 .csproj 中添加以下内容

 <StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>

在那之后詹金斯构建失败了。但是违规页面仍然是空的。

我浏览了很多文章,但无法清楚地了解需要做什么。我找不到任何分步教程。如果有人可以发布分步教程或链接,那将很有帮助。

【问题讨论】:

    标签: c# jenkins jenkins-plugins stylecop


    【解决方案1】:

    我解决了这个问题。以下是解决此问题的详细步骤。

    1. 在 Jenkins 中添加 Violations 插件

    2. 在后期构建步骤中添加 Report Violations 。指定生成 stylecopviolations.xml 文件的位置。

    此文件将被创建 jenkins 工作区文件夹 -> 应用程序文件夹 -> Obj -> 调试 -> Stylecopviolations.xml 。所以在下面的部分我们需要指定为 * / */ */ SyleCopViolations.xml 。

    1. 现在您将能够在违规页面中看到 stylecop 违规情况

    【讨论】:

      【解决方案2】:

      希望得到帮助:**/*/StyleCopViolations.xml

      【讨论】:

      • 再描述一下你的答案
      猜你喜欢
      • 1970-01-01
      • 2017-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-03
      • 2021-03-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多