Monday, April 2, 2012

Jenkins Violations plugin quirk

Now that I got OpenCover working with Jenkins, I decided to go after fxCop. Here's the command-line I settled on:

"C:\Program Files (x86)\Microsoft Fxcop 10.0\fxcopcmd.exe" /oxsl:none /igc /f:OurApp.AssemblyToCover1.dll  /f:OurApp.AssemblyToCover2.dll /out:fxcop_results.xml /d:"c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies"

The /oxsl: argument specifies no xsl transformation on the output (I'm using the Violations plugin which reads the native xml).

The /d: argument points to where System.Web.Mvc.dll lives, which one of our assemblies depends on.

As I mentioned before, I want to exclude several assemblies from analysis, so I specified the ones I want included by using /f: arguments (one per assembly).

NOTE: Getting the Violations plugin to work was easy once I realized one thing: the "XML filename pattern" must either be a filename pattern only (in which case the file will be in the Jenkins build project's workspace directory) or it must be in a directory below the Jenkins build project's workspace directory (for example results\fxCop*.xml) Absolute paths and relative paths starting with "..\" do not work.

No comments:

Post a Comment