制作 StyleCop &詹金斯听从我的命令

发布于 2024-12-21 16:32:33 字数 616 浏览 1 评论 0原文

我们正在尝试使用最新版本的 StyleCop 设置 Jenkins。

我们现有的 Jenkins 设置通过 StyleCopCmd 通过 nant 调用 StyleCop,但 StyleCopCmd 似乎越来越过时且无人维护;我宁愿把它剪掉。因此,最好的支持解决方案似乎是从 msbuild 调用 StyleCop。

我们的解决方案由多个项目组成,但 Jenkins Violations 插件需要一个 stylecop.violations.xml 文件,因此广泛记录的导入 StyleCop.targets 并从中调用它的解决方案每个“csproj”文件似乎都不起作用(因为这会产生多个违规文件,Jenkins 插件无法处理)。

SO:

  1. 是否有某种方法可以合并多个 StyleCop 违规文件,以便 Jenkins Violations 插件将它们视为一个文件,或者
  2. 在 Msbuild 中是否有某种方法可以查看多个“.csproj”文件,提取“.cs”文件并通过 StyleCop 一次性运行它们。或者:
  3. 鉴于我们使用 Jenkins 和多个项目文件,是否有另一种方法来报告解决方案中所有项目的违规行为?

非常感谢任何帮助。

We're trying to set up Jenkins with the latest version of StyleCop.

Our existing Jenkins setup invokes StyleCop via StyleCopCmd via nant, but StyleCopCmd seems to be increasingly out-of-date, and unmaintained; and I’d rather cut it out. So best supported solution seems to be to invoke StyleCop from msbuild.

Our solution consists of multiple projects, but the Jenkins Violations plugin expects a single stylecop.violations.xml file, so the widely documented solution of importing StyleCop.targets and invoking it from each 'csproj' file seems like it won’t work (because this would produce multiple violations files, which the Jenkins plugin can't cope with).

SO:

  1. Is there some way of merging multiple StyleCop violations files so that they are treated as one by the Jenkins Violations plugin, OR
  2. Is there some way, in Msbuild, of peeking into multiple '.csproj' files, extracting the '.cs' files and running them all through StyleCop in a one-er. Alternatively:
  3. Given we're using Jenkins and multiple project files, is there another way of reporting violations for all of the projects in the solution?

Any help gratefully received.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼波传意 2024-12-28 16:32:33

请参阅:http://ferritedog.wordpress.com/2011/05/27/1-hour-guide-to-continuous-integration-setup-jenkins-meets-net/

基本上,使用 XML 文件名模式 **/*/StyleCopViolations.xml

See this: http://ferritedog.wordpress.com/2011/05/27/1-hour-guide-to-continuous-integration-setup-jenkins-meets-net/

Basically, use the XML FileName Pattern **/*/StyleCopViolations.xml.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文