从 MSBuild Runner 中排除项目而不更改 csproj 文件 [英] Excluding projects from the MSBuild Runner without changing csproj files

查看:16
本文介绍了从 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:

https://jira.sonarsource.com/projects/SONARMSBRU/issues/SONARMSBRU-191

这篇关于从 MSBuild Runner 中排除项目而不更改 csproj 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆