Romanx / Cake.Coverlet

Coverlet extensions for Cake Build
MIT License
40 stars 15 forks source link

Enum defined in assembly not referenced. #13

Closed austinlparker closed 5 years ago

austinlparker commented 5 years ago

When trying to use Cake.Coverlet, I get an intellisense error creating a CoverletSettings - The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [build.cake]

The following is the task:

Task("Test")
.IsDependentOn("Build")
.Does(() =>
    {
        var project = ("./test/LightStep.Tests/LightStep.Tests.csproj");
        var coverletSettings = new CoverletSettings {
            CollectCoverage = true,
            CoverletOutputFormat = CoverletOutputFormat.opencover,

        };
        var testSettings = new DotNetCoreTestSettings {
            Logger = "xunit;LogFilePath=../../build/test_results.xml",
            Verbosity = DotNetCoreVerbosity.Minimal
        };
        DotNetCoreTest(project, testSettings, coverletSettings);
});

I'm using Cake 0.30 on MacOS with dotnet version 2.1.401.

austinlparker commented 5 years ago

I also get the following error when I run the task, regardless of if CoverletOutputFormat is defined. - Calculating coverage result... /Users/austinparker/.nuget/packages/coverlet.msbuild/2.3.2/build/netstandard2.0/coverlet.msbuild.targets(27,5): error : Specified output format '0' is not supported [/Users/austinparker/workspace/lightstep-tracer-csharp/test/LightStep.Tests/LightStep.Tests.csproj]

Romanx commented 5 years ago

Hi there,

I think it's due to the way that i'm turning the enumeration into a string to pass into the MsBuild task. I'll take a look at this later today, hopefully it should just be a case of using Invariant ToString() I don't have a mac to test it.

Would you be interested in trying a pre-release build to verify this works for you locally?

austinlparker commented 5 years ago

Sure, I can try the pre-release build.

Romanx commented 5 years ago

Hi @austinlparker, i've merged this into master and it'll be released along with the Coverlet tool functionality in 2.0. Thanks for the contribution!

Romanx commented 5 years ago

@austinlparker This has now been released. Please let me know if you have any issues.

giusepe commented 5 years ago

Hi @Romanx,

I'm still getting the same error with the coverlet 2.2.1

screenshot 2019-01-23 at 17 17 10

I'm running it on Mac as well.

Romanx commented 5 years ago

@giusepe How are including Cake.Coverlet in your cake file? Are you using #tool directive?

giusepe commented 5 years ago

Hi @Romanx,

Oh sorry, I forgot to link it before: https://github.com/reactiveui/punchclock/blob/update-ci-to-reactiveui/build.cake I'm not, and now that you mentioned, I think I should have....