question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extract common Library to enable consumption from other tools

See original GitHub issue

I want to write a Cake addin for MiniCover like the one that exists for OpenCover. I cannot easily instruct users to add MiniCover as a tool as the way cake downloads tools from Nuget is not compatible with the DotnetCliTool package type. I could tell users to create a tools project as instructed in the README and pass that to my addin, but I think an easier solution is if we separate the actual instrumentation and reporting logic from the dotnet cli tool frontend. This would allow me to reference it as a dependency in my package and enable users to get simple coverage with something like:

#addin "Cake.MiniCover"

// ...

Task("Coverage")
    .IsDependentOn("build")
    .Does(() => 
{
    MiniCover(tool =>
        {
            foreach(var project in GetFiles("./test/**/*.csproj"))
            {
                tool.DotNetCoreTest(project.FullPath, new DotNetCoreTestSettings()
                {
                    // Required to keep instrumentation added by MiniCover
                    NoBuild = true,
                    Configuration = configuration
                });
            }
        },
        new MiniCoverSettings()
            .WithAssembliesMatching("./test/**/*.dll")
            .WithSourcesMatching("./src/**/*.cs")
            .GenerateReport(ReportType.CONSOLE | ReportType.XML)
    );
});

// ...

Then, generating coverage becomes as simple as

./build.sh -t Coverage

# Or on Windows:

./build.ps1 -t Coverage

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ffMathycommented, Dec 16, 2020

I love it! 😍

1reaction
day01commented, Mar 10, 2018

@nlowe Looks really good. @lucaslorentz do you plan to create a project on github? That would be nice to have kanban with tasks. Maybe the common board with Cake.MiniCover (@nlowe)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Java Library Plugin
A library is a Java component meant to be consumed by other components. It's a very common use case in multi-project builds, but...
Read more >
Work with Azure Functions Core Tools
Core Tools lets you create function app projects for the .NET runtime as either in-process or isolated worker process C# class library projects ......
Read more >
20 Must-Have Python Libraries for Data Science in 2023
Discover the top Python libraries for Data Science, including TensorFlow, SciPy, NumPy, Pandas, Matplotlib, Keras, and more.
Read more >
Getting Started | Consuming a RESTful Web Service
This guide walks you through the process of creating an application that consumes a RESTful web service. What You Will Build. You will...
Read more >
Database Export Tool - CSM - Cherwell Help
Use the Export Data option in CSM Administrator to export a selected CSM Database to a compressed Cherwell Archive Repository (.czar) file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found