从 sonar-runner 迁移到 MSBuild Runner.sonar-project.properties 文件去哪儿了? [英] Migrating from sonar-runner to MSBuild Runner. Where did the sonar-project.properties file go?

查看:29
本文介绍了从 sonar-runner 迁移到 MSBuild Runner.sonar-project.properties 文件去哪儿了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:我正在将我们当前的 VS 解决方案分析设置从使用 sonar-runner 迁移到使用 MSBuild runner.但是我遇到了一个相当重要的问题.

Scenario: I am migrating our current VS Solution analysis setup from using the sonar-runner to using the MSBuild runner. However I am encountering a fairly significant problem.

在旧设置中,我们使用 sonar-project.properties文件.

In the old setup, we specified our project name, key and most importantly a long list of skipped projects (sonar.visualstudio.skippedProjectPattern) using the sonar-project.properties file.

这是因为 [警告:丑陋的遗留不良编码实践警报] 我们有六个解决方案,可以构建数十个项目,所有项目都来自同一个 git 存储库.许多项目在多个解决方案中都很常见,我们不希望对它们进行多次分析.因此,每个解决方案都有一组它拥有"的项目,并作为其中的一部分进行分析.因此,每个其他解决方案的 sonar-project.properies 文件指定这些项目将被忽略.

This is because [WARNING: ugly legacy bad coding practice alert] we have six solutions that build dozens and dozens of projects, all out of the same git repo. A lot of the projects are common across several solutions and we don't want them analyzed more than once. So each solution has a set of projects that it "owns" and which are analyzed as part of it. Thus the sonar-project.properies file for each of the other solutions specifies that these projects are to be ignored.

问题:在新的 MSBuild Runner 方法中,似乎没有 MS 解决方案级别(也读作 SonarQube 项目级别)配置文件或机制除了将命令行上的参数传递给 MSBuild 运行器的开始"阶段.一个要么具有全局配置文件,要么具有 MSBuild *.*proj 文件(即 MS 项目级别 配置文件).后者显然是不可能的,因为项目是否被排除在分析之外是基于正在分析的解决方案.

The Problem: In the new MSBuild Runner approach, there does not appear to be MS solution level (also read as SonarQube Project level) configuration file or mechanism aside from passing arguments on the command line to the MSBuild runner's 'begin' phase. One either has the global configuration file, or the MSBuild *.*proj files, (that is, MS project level configuration files). This latter is clearly out of the question as whether a project gets excluded from analysis is based on which solution is being analyzed.

如前所述,可以想象我们可以在命令行中传递所有这些,但这是次优的.我们的构建是由尽可能通用的脚本完成的.在 sonar-project.properities 文件中进行配置对保持这种方式有很大帮助,我们希望在这里遗漏一些东西,让我们继续使用该文件或类似文件.我们是吗?

As noted, conceivably we could pass all this in on the command line but that is sub optimal. Our builds are done by scripts that are, to the extent possible, generic. Having the configuration in the sonar-project.properities file was a big help in keeping them that way and we are hoping we are missing something here that will let us keep using that file or a similar one. Are we?

推荐答案

目前在 MSBuild SonarQube Runner 1.0 版中没有对应的 sonar-project.properties 文件.我在项目的积压工作中添加了一张新票,以考虑在即将发布的版本中添加此功能:http://jira.sonarsource.com/browse/SONARMSBRU-124

There currently is no equivalent to the sonar-project.properties file in the MSBuild SonarQube Runner version 1.0. I've added a new ticket to the project's backlog to consider adding this feature in an upcoming release: http://jira.sonarsource.com/browse/SONARMSBRU-124

这篇关于从 sonar-runner 迁移到 MSBuild Runner.sonar-project.properties 文件去哪儿了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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