在TFS 2010内部版本中指定代码分析设置 [英] Specifying code analysis setting in TFS 2010 build

查看:67
本文介绍了在TFS 2010内部版本中指定代码分析设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在TFS 2010的构建定义中,当执行代码分析设置为始终时,如何指定自定义代码分析规则文件?

In the build definition of TFS 2010, when "Perform Code Analysis" set to "Always" how can I specify a custom code analysis rules file?

构建味道是发行。

我不想为 Perform Code Analysis设置 AsConfigured,以便从proj文件中选择设置。

I prefer not to set "AsConfigured" for "Perform Code Analysis" so that the settings are picked from proj file.

谢谢。

推荐答案

您应该可以使用生成过程参数配置中的 MSBuild Arguments条目,以提供 / property 命令行条目,该条目将传递给MSBuild,从而允许覆盖 CodeAnalysisRuleSet 要应用的属性值。

You should be able to use the "MSBuild Arguments" entry in your build process parameters configuration to provide a /property command line entry that will be passed to MSBuild, thereby allowing override of the CodeAnalysisRuleSet property value to be applied.

取决于您如何在现有项目中设置CodeAnalysisRuleSet属性值,您可能还需要进行调整值分配以现有值为空为条件。如果需要这样做,您可能想考虑利用这个机会将所有项目的代码分析配置移到单独的.targets文件中,以便将来可以更轻松地对其进行调整。

Depending on how you have set up the CodeAnalysisRuleSet property values in your existing projects, you may also need to tweak the value assignments to be conditional on the pre-existing value being empty. If you need to do this, you might want to consider taking the opportunity to move the code analysis configuration for all projects into a separate .targets file so that they can be tweaked more easily in the future.

这篇关于在TFS 2010内部版本中指定代码分析设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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