This repository contains the source code for: FxCopParser.exe
I faced a paticular issue while trying to integrate FxCop with Jenkins.
The specific scenario I tried to achieve was, 'If there's an error reported by FxCop, the Jenkins job should fail.'
Even though Violation Plugin https://wiki.jenkins.io/display/JENKINS/Violations helped with the visualisation of the errors, it didn't help with achieving the build failure that I wanted.
Here's my FxCop.project configurations:
"C:\Program Files (x86)\Microsoft Fxcop 10.0\FxCopCmd.exe" /project:"D:\Testing\Source\FxCop\BrokerApplication.FxCop" /out:"D:\Testing\Source\FxCop\BrokerApplication.xml"
It's a very simple console application.
This program will read the FxCop report and calculate the following:
- criticalErrors
- errors
- criticalWarnings
- warnings
and if there are any criticalErrors or errors will will output the exit code Exit(1)
- Checkout FxCopParser.exe (under release folder)
- Pass the FxCop result xml file to it
"D:\Testing\Source\FxCop\FxCopParser.exe" "D:\Testing\Source\FxCop\BrokerApplication.xml"
If there are any criticalErrors or errors reported in the xml, if will return the exit code Exit(1)