MSBuild和IgnoreStandardErrorWarningFormat [英] MSBuild and IgnoreStandardErrorWarningFormat

查看:112
本文介绍了MSBuild和IgnoreStandardErrorWarningFormat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个MSBuild项目,该项目将使用doxygen生成html文档.除了一个示例,似乎不完整;它不会解析脱氧警告.

I'm trying to write a MSBuild project that will generate html documentation using doxygen. I couldn't find anything about that on the net except for one example, which seems incomplete; it doesn't parse doxygen warnings.

我发现 MSBuild的Exec 任务具有类似IgnoreStandardErrorWarningFormat和CustomWarningRegularExpression的参数.什么是标准错误/警告格式"?这些属性中允许使用哪种RE?

I found that MSBuild's Exec task has parameters like IgnoreStandardErrorWarningFormat and CustomWarningRegularExpression. What is the "Standard Error/Warning Format" and what kind of REs are allowed in these properties?

啊,在Microsoft Build Engine内部"错误地将其描述为.NET 3.5中的属性,该属性实际上是从4开始.

ah, "Inside the Microsoft Build Engine" wrongly describes it as property in .NET 3.5, where it is actually from 4. No use for me...

推荐答案

此处描述了标准的msbuild错误/警告格式:

The standard msbuild error/warning format is described here: http://blogs.msdn.com/b/msbuild/archive/2006/11/03/msbuild-visual-studio-aware-error-messages-and-message-formats.aspx.

简而言之,格式为:

MSBuild可以识别许多通常写入控制台的命令行工具特别格式化的错误消息和警告.例如,请查看以下错误消息-它们均已正确格式化为对MSBuild和Visual Studio友好.

MSBuild recognizes error messages and warnings that have been specially formatted by many command line tools that typically write to the console. For instance, take a look at the following error messages - they are all properly formatted to be MSBuild and Visual Studio friendly.

Main.cs(17,20): warning CS0168: The variable 'foo' is declared but never used 
C:\dir1\foo.resx(2) : error BC30188: Declaration expected.
cl : Command line warning D4024 : unrecognized source file type 'foo.cs', object file assumed
error CS0006: Metadata file 'System.dll' could not be found.

这些消息确认为如下所示的特殊格式,包括5个部分-这些部分的顺序很重要,不应更改:

These messages confirm to special format that is shown below, and comprise 5 parts - the order of these parts are important and should not change:

来源(必填)

来源可以为空白.如果存在,则原点通常是工具名称,例如其中一个示例中的"cl".但是它也可以是文件名,如另一个示例中所示的"Main.cs".如果它是文件名,则它必须是绝对文件名或相对文件名,其后是以下格式之一的可选的带括号的行/列信息:

Origin can be blank. If present, the origin is usually a tool name, like 'cl' in one of the examples. But it could also be a file name, like 'Main.cs' shown in another example. If it is a file name, then it must be an absolute or a relative file name, followed by an optional parenthesized line/column information in one of the following forms:

(line) or (line-line) or (line-col) or (line,col-col) or (line,col,line,col)

子类别(可选)

子类别用于进一步对类别进行分类,因此不应进行本地化.

Subcategory is used to classify the category itself further, and should not be localized.

类别(必填)

类别必须是错误"或警告".大小写无所谓.像起源一样,类别不得本地化.

Category must be either 'error' or 'warning'. Case does not matter. Like origin, category must not be localized.

代码(必填)

代码标识特定于应用程序的错误代码/警告代码.代码不得本地化,且不得包含空格.

Code identifies an application specific error code / warning code. Code must not be localized and it must not contain spaces.

文本(可选)

解释错误的用户友好文本,并且必须进行本地化,以适应多种语言环境.

User friendly text that explains the error, and must be localized if you cater to multiple locales.

这篇关于MSBuild和IgnoreStandardErrorWarningFormat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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