Embed SLOCCount into Jenkins jobs

Preparation

Install SLOCCount and cloc on system.

Example:

Search and install the “SLOCCount Plugin”.

jenkins sloccount plugin

Configure

Now search your job and start configuration and insert the command “Build > Execute Shell”.

As last step add the Post-Build-Action – “View SLOCCount results” and insert the generated report “sloccount_report.sc”.

sloccount result path

The plugin just show the number of lines per file, file type and folder. No estimated project value or other informations! This information you can see direct on generated report.

After running the build, your screen should look similar like this:

sloccount report