Examples
The following example will call JetBrains InspectCode and output the number of warnings.
To call JetBrains InspectCode from a Cake script you need to add the JetBrains.ReSharper.CommandLineTools
:
To read issues from InspectCode log files you need to import the core addin and the InspectCode support:
Warning
Please note that you always should pin addins and tools to a specific version to make sure your builds are deterministic and won't break due to updates to one of the packages.
See pinning addin versions for details.
We need some global variables:
The following task will run JetBrains InspectCode and write a log file:
Task("Analyze-Project").Does(() =>
{
// Run InspectCode.
var settings = new InspectCodeSettings() {
OutputFile = logPath
};
InspectCode(repoRootPath.CombineWithFilePath("MySolution.sln"), settings);
});
Finally you can define a task where you call the core addin with the desired issue provider.