gpt4 book ai didi

MSBuild 和 IgnoreStandardErrorWarningFormat

转载 作者:行者123 更新时间:2023-12-02 13:17:43 24 4
gpt4 key购买 nike

我正在尝试编写一个 MSBuild 项目,它将使用 doxygen 生成 html 文档。除了 example 之外,我在网上找不到任何相关信息。 ,这似乎不完整;它不解析 doxygen 警告。

我发现MSBuild's Exec任务具有 IgnoreStandardErrorWarningFormat 和 CustomWarningRegularExpression 等参数。什么是“标准错误/警告格式”以及这些属性中允许使用什么类型的 RE?

编辑:啊,“Microsoft Build Engine 内部”错误地将其描述为 .NET 3.5 中的属性,实际上它来自 4。对我来说没有用...

最佳答案

标准的 msbuild 错误/警告格式描述为 here .

简单来说,格式是:

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.

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:

Canonical Errors/Warnings

Origin (Required)

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 (Optional)

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

Category (Required)

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

Code (Required)

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

Text (Optional)

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

关于MSBuild 和 IgnoreStandardErrorWarningFormat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3441452/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com