从 MSBuild Runner 中排除项目而不更改 csproj 文件

编程入门 行业动态 更新时间:2024-10-24 10:25:53
本文介绍了从 MSBuild Runner 中排除项目而不更改 csproj 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用 SonarQube 5.2 (MSBuild.SonarQube.Runner.exe)... 给定一个包含 10 个 C# 项目的 Visual Studio 解决方案,是否可以从 SonarQube 分析中排除一半项目,而无需直接编辑 *.csproj 文件?(我正在使用共享代码库,不想使用 SonarQube 特定配置污染项目文件).

Using SonarQube 5.2 (MSBuild.SonarQube.Runner.exe)... Given a Visual Studio solution containing 10 C# projects, is it possible to exclude half of those projects from SonarQube analysis without having to edit the *.csproj files directly? (I'm working with a shared code-base and don't want to pollute the project files with SonarQube specific configuration).

我已尝试利用分析范围的源文件包含"和源文件排除"设置但未能成功,因为源文件路径似乎与项目目录相关且不包括基本路径.

I've tried and failed to leverage the Analysis Scope 'Source File Inclusions' and 'Source File Exclusions' settings because the source file paths appear to be relative to the project directory and do not include the base path.

例如如果我的基本目录"是C:SourceProjectsProject1",则源路径被检测为 Source1.cs、Source2.cs、SubFolder/Source3.cs 等,这可以防止 ** 的包含或排除规则Project1***.cs 从工作中.

e.g. if my 'Base dir' is 'C:SourceProjectsProject1' the source paths are detected as Source1.cs, Source2.cs, SubFolder/Source3.cs, etc. and this prevents an inclusion or exclusion rule of **Project1***.cs from working.

有没有人知道一种方法来完成我所需要的,而不需要描述的笨拙的冗长的东西 这里 和 这里?例如,有没有办法改变MSBuild.SonarQube.Runner.exe"认为的基本路径?

Does anyone know of a way to accomplish what I need without the klunky rigmarole described here and here? Is there a way to change what 'MSBuild.SonarQube.Runner.exe' considers the base path for instance?

推荐答案

确实,sonar.exclusions 在这种情况下不起作用.我记录了一个错误来跟踪这个:

Indeed, sonar.exclusions does not work in this case. I logged a bug to track this:

jira.sonarsource/projects/SONARMSBRU/issues/SONARMSBRU-191

更多推荐

从 MSBuild Runner 中排除项目而不更改 csproj 文件

本文发布于:2023-11-16 17:00:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606161.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不   文件   项目   MSBuild   Runner

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!