Re:Jenkins with Cppcheck plugin in a Windows / Visual Studio environment

648 views
Skip to first unread message

Kevin Fleming (BLOOMBERG/ 731 LEXIN)

unread,
Nov 6, 2013, 2:21:15 PM11/6/13
to jenkins...@googlegroups.com
You are correct. The cppcheck plugin only provides a Publisher, not a Build Step, so you will need to arrange for cppcheck to be run by one of the steps in your project. it doesn't get 'attached' to msbuild, you'll need to run an 'Execute Shell' step in your project and then run cppcheck to analyze your source code.

----- Original Message -----
From: jenkins...@googlegroups.com
To: jenkins...@googlegroups.com
At: Nov 6 2013 04:57:31
Hey all,

I am a new user to Jenkins and so far had no issues with using some plugins and building my VS C++ projects. I am trying to set it up to use cppcheck for the builds, I "thought" I set it up correctly, but I basically get this:

No valid cppcheck data available

This plugin will not report cppcheck result until there is at least one success or unstable build.

I couldn't find any clear information or guides on the net to help correctly setup the cppcheck plugin in a Windows environment, hopefully someone here can help.

I have cppcheck installed on my machine, only used the cppcheckGUI successfully, but the commandline version is there too. I'm assuming Jenkins doesn't actually use cppcheck, instead it just reads an XML file generated by the cppcheck at the end of a build? So does this mean cppcheck must be attached to MSBuild.exe in some shape or form?

Any information to properly set this up is appreciated :)


             

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Grey

unread,
Nov 7, 2013, 11:05:19 AM11/7/13
to jenkins...@googlegroups.com, Kevin Fleming
Alright so, I've actually never written shell scripts before (as I said i'm new to this whole procedure :) ) 
It looks like I've got some learning and research to do, but in a nutshell is this how it's supposed to work?

Have a shell script to do whatever (build projects etc)
In that script, I will also parse commands to cppcheck.exe to check the project folders in the build, also making cppcheck generate an XML after it has checked all the projects.
Finally, the Jenkins plugin will launch the generated XML file, which it finds by me giving it the file location in the "Cppcheck report XMLs" textbox field in the build configuration.


Am I on the right track?

Kevin Fleming (BLOOMBERG/ 731 LEXIN)

unread,
Nov 7, 2013, 11:07:21 AM11/7/13
to jenkins...@googlegroups.com
Yes, that's essentially right.

How are you executing MSBUILD in your project now, if you aren't using an 'Execute Shell' build step?

Grey

unread,
Nov 16, 2013, 7:21:13 AM11/16/13
to jenkins...@googlegroups.com, Kevin Fleming
Hey,

Sorry for the late reply, i've been suprisingly busy for a while!

I use this plugin: https://wiki.jenkins-ci.org/display/JENKINS/MSBuild+Plugin

it has dropdown lists to build a project, though you can only add one project to the list at a time, so you have to create many entries in the build configuration. So yeah obviously a shell script is the most logical idea.

Now i'm back, hopefully I can see some Shell scripts and have fun :)
Reply all
Reply to author
Forward
0 new messages