Cake.Issues.MsBuild

The MsBuild support for the Cake.Issues addin allows you to read issues logged as warnings in a MsBuild log. This addin provides the aliases for reading MsBuild warnings and providing them to the Cake.Issues addin. It also requires the core Cake.Issues addin. There are also additional addins for generating reports or posting issues to pull requests. See cakeissues.net for an overview of the whole ecosystem of addins for working with issues in Cake scripts.

#addin nuget:?package=Cake.Issues.MsBuild&version=0.9.1

<package id="Cake.Issues.MsBuild" version="0.9.1" />

dotnet add package Cake.Issues.MsBuild --version 0.9.1

<PackageReference Include="Cake.Issues.MsBuild" Version="0.9.1" />

Aliases

Contains functionality for reading warnings from MSBuild log files.

Issue Providers

MsBuildAddRuleUrlResolver(ICakeContext, Func<MsBuildRuleDescription, Uri>) Registers a new URL resolver with default priority of 0.
MsBuildAddRuleUrlResolver(ICakeContext, Func<MsBuildRuleDescription, Uri>, int) Registers a new URL resolver with a specific priority.
MsBuildBinaryLogFileFormat Gets an instance for the MsBuild binary log format.
MsBuildIssues(ICakeContext, MsBuildIssuesSettings) Gets an instance of a provider for issues reported as MsBuild warnings using specified settings.
MsBuildIssuesFromContent(ICakeContext, string, BaseMsBuildLogFileFormat) Gets an instance of a provider for issues reported as MsBuild warnings using log content.
MsBuildIssuesFromFilePath(ICakeContext, FilePath, BaseMsBuildLogFileFormat) Gets an instance of a provider for issues reported as MsBuild warnings using a log file from disk.
MsBuildIssuesProviderTypeName Gets the name of the MsBuild issue provider. This name can be used to identify issues based on the ProviderType property.
MsBuildXmlFileLoggerFormat

Gets an instance for the MsBuild log format as written by the XmlFileLogger class from MSBuild Extension Pack.

You can add the logger to the MSBuildSettings like this:

var settings = new MSBuildSettings()
    .WithLogger(
        Context.Tools.Resolve("MSBuild.ExtensionPack.Loggers.dll").FullPath,
        "XmlFileLogger",
        string.Format(
            "logfile=\"{0}\";verbosity=Detailed;encoding=UTF-8",
            @"c:\build\msbuild.log")
    );

In order to use the above logger, include the following in your build.cake file to download and install from NuGet.org:

#tool "nuget:?package=MSBuild.Extension.Pack"