不确定这是否正是您正在寻找的,但我使用编译器警告插件来趋势我的 CLANG-LLVM 编译器警告。这必须在 Jenkins 系统级别定义(仍然是 GUI,但不是每个项目):
Name: CLANG-LLVM
Link Name: Compiler Warnings
Trend Report Name: Warning trend
Regular Expression: ^(.+?):(\d+):(?:\d+:)?(?:\{\d:-\}+)?(?:.*) (warning|error): (.*)$
Mapping Script:
import hudson.plugins.warnings.parser.Warning
String fileName = matcher.group(1)
String lineNumber = matcher.group(2)
String category = matcher.group(3)
String message = matcher.group(4)
if (message.contains('deprecated')) category='deprecation';
return new Warning(fileName, Integer.parseInt(lineNumber), "Clang-LLVM", category, message);
Example Log Message:
/Development/foo.m:4634:7: warning: 'runModalForDirectory:file:' is deprecated [-Wdeprecated-declarations,6]
然后我们在控制台日志的构建后扫描中运行它。并且,在Advanced...
警告部分,您可以告诉它如何解释“健康警告”和状态设置。