我是一个C#项目:https://github.com/Pro/dkim-exchange
它使用Travis CI:https://travis-ci.org/Pro/dkim-exchange
Travis成功构建了我的项目。
我想设置Coverity来进行自动代码质量测量。为此,我按如下方式配置了.travis.yml
:
language: objective-c
env:
global:
- EnableNuGetPackageRestore=true
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "kC7O0CWm9h4g+tzCwhIZEGwcdiLrb1/1PijeOKGbIWGuWS7cIksAkj2tRNMgtxxcE9CFQr8W7xDv2YzflCIlqN1nGkFjbyD4CrNg6+V1j0fZjPOQ6ssdBBVPrfrvecsAUJ0/48Tqa9VTkEpZSlwOF/VS1sO2ob36FVyWjtxvG9s="
matrix:
- MONO_VERSION="3.10.0"
install:
# Fetch Mono
- wget "http://download.mono-project.com/archive/${MONO_VERSION}/macos-10-x86/MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.x86.pkg"
- sudo installer -pkg "MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.x86.pkg" -target /
script:
- xbuild travis.proj
addons:
coverity_scan:
project:
name: "Pro/dkim-exchange"
description: "Build submitted via Travis CI"
notification_email: mail@example.com
build_command_prepend: "xbuild /t:CleanAll travis.proj"
build_command: "xbuild /t:Build travis.proj"
branch_pattern: coverity_scan
如果我执行此处所示的coverity构建命令(使用msbuild):https://scan.coverity.com/download?tab=csharp正确分析上传的档案,但与travis结合,覆盖率分析失败(参见例如此构建日志:{{3 }})。 有这个警告:
[WARNING] No files were emitted. This may be due to a problem with your configuration
or because no files were actually compiled by your build command.
Please make sure you have configured the compilers actually used in the compilation.
我认为这可能与Mono的xbuild有关。不幸的是谷歌博士并没有找到关于Coverity + xbuild的任何信息。 Coverity是否支持xbuild?如果是,我该如何正确设置项目?
答案 0 :(得分:4)
说到C#,Coverity实际上只支持msbuild。
您可以在以下
中找到更多有关此内容的官方信息最后一个链接明确说明
我们的C#分析仅支持Visual Studio C#编译器
所以,截至目前还没有xbuild支持。
当您 download Coverity构建工具时,doc/en/help/cov-build.txt
会明确说明以下内容:
仅在Windows上支持C#构建捕获。