Excluding projects from the MSBuild Runner without changing csproj files

不打扰是莪最后的温柔 提交于 2019-11-30 18:34:10

问题


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.

e.g. if my 'Base dir' is 'C:\Source\Projects\Project1' 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.

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?


回答1:


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



来源:https://stackoverflow.com/questions/34010376/excluding-projects-from-the-msbuild-runner-without-changing-csproj-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!