简体   繁体   中英

Does Coverity support xbuild (mono)?

I've a C# project: https://github.com/Pro/dkim-exchange

It uses Travis CI: https://travis-ci.org/Pro/dkim-exchange

Travis successfully builds my project.

I wanted to set up Coverity to do automatic code quality measurements. For this I configured my .travis.yml as follows:

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

If I execute the coverity build commands as indicated here (using msbuild): https://scan.coverity.com/download?tab=csharp the uploaded archive is analyzed correctly, but in combination with travis, the coverity analysis fails (see eg this build log: https://travis-ci.org/Pro/dkim-exchange/builds/42295611 ). There's this warning:

[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.

I think this may be related to xbuild from Mono. Unfortunately Dr. Google didn't find anythin about Coverity+xbuild. Does Coverity support xbuild? If yes, how can I correctly setup the project?

When it comes to C#, Coverity actually only supports msbuild.

You can find some more official information about this in the following

The last link explicitly states

Our C# analysis only supports the Visual Studio C# compilers

So, no xbuild support as of now.

Update:

When you download the Coverity build tool, the doc/en/help/cov-build.txt explicitly states the following:

C# build capture is only supported on Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM