Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

DotNetCore[Build|Publish] Support #51

Closed
dustinchilson opened this issue Oct 4, 2018 · 2 comments
Closed

DotNetCore[Build|Publish] Support #51

dustinchilson opened this issue Oct 4, 2018 · 2 comments
Assignees

Comments

@dustinchilson
Copy link

In my Build script I'm attempting to do this to generate the build output for the Issue tool.

DotNetCorePublish(".", new DotNetCorePublishSettings
        {
            Configuration = configuration,
            NoRestore = true,
            MSBuildSettings = new DotNetCoreMSBuildSettings()
                .WithLogger(
                    Context.Tools.Resolve("MSBuild.ExtensionPack.Loggers.dll").FullPath,
                    "XmlFileLogger",
                    $"logfile=\"{msBuildLogFile}\";verbosity=Detailed;encoding=UTF-8"
                )
        });

This does not work as the MSBuild.ExtensionPack.Loggers.dll doesn't work in the dotnet core msbuild Per dotnet/msbuild#2111.

Is there a work around? I see #38 which might also work but doesn't seem to be an active case.

@pascalberger
Copy link
Member

You can check out version 0.6.1-beta0002 which contains support for binary logs.

To use binary logs (proper documentation will follow once officially released):

#addin "Cake.Issues.MsBuild&prerelease"

var settings = new MSBuildSettings();
settings.BinaryLogger =
    new MSBuildBinaryLogSettings() 
    { 
        Enabled = true, 
        FileName = @"c:\repo\output.binlog" 
    };
MSBuild(@"c:\repo\mysolution.sln", settings);

var settings =
    new ReadIssuesSettings(@"c:\repo")
    {
        Format = IssueCommentFormat.Markdown
    };

var issues =
    ReadIssues(
        MsBuildIssuesFromFilePath(
            @"c:\repo\output.binlog",
            MsBuildBinaryLogFileFormat)
        settings));

Please not that binary logs contain the whole environment including all environment variables, which might be a security concern.

If binary logs don't work for you, it's quite easy to implement support for any other logger to Cake.Issues.MsBuild as long as the generated output is in any machine readable form.

Please let me know if the binary logs work for you and I can do a proper release containing support for it.

@pascalberger pascalberger self-assigned this Oct 5, 2018
@pascalberger
Copy link
Member

@dustinchilson Version 0.6.1 with support for binary logger has been released.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants