Skip to content

joaoasrosa/dotnet-project-dependencies-analyser

Repository files navigation

Cake.DependenciesAnalyser

A Cake AddIn to analyse the NuGet dependencies of a C# project.

Build status NuGet cakebuild.net

The addin uses the information on the csproj or packages.config for the NuGet packages used in the project, doing a analysis:

  • Using the version of the package, verifies if a newer version is available
  • Produces a inline report with the NuGet dependencies versions listed

Report Sample


---------------------------------
Project: ./src/Cake.DependenciesAnalyser/Cake.DependenciesAnalyser.csproj
Cake.Core is on version 0.26.1. The dependency is up-to-date.
Newtonsoft.Json is on version 11.0.2. The dependency is up-to-date.
---------------------------------

---------------------------------
Project: ./src/DependencyChecker.NuGet.Adapter/DependencyChecker.NuGet.Adapter.csproj
Newtonsoft.Json is on version 11.0.2. The dependency is up-to-date.
Semver is on version 2.0.4. The dependency is up-to-date.
---------------------------------

---------------------------------
Project: ./src/Domain/Domain.csproj
Semver is on version 2.0.4. The dependency is up-to-date.
---------------------------------

Known limitations

  • We pretend to add a solution analyses to verify package references vs DLL references

Usage

Including the addin

To include the addin, add the following to the beginning of the cake script:

#addin "Cake.DependenciesAnalyser"

Use the addin

To use the addin, you need to configure the settings and run the AnalyseDependencies alias:

#addin "Cake.DependenciesAnalyser"
...
Task("Dependencies-Analyse")
    .Description("Runs the Dependencies Analyser on the solution.")
    .Does(() => 
    {
        var settings = new DependenciesAnalyserSettings
        {
            Folder = "./src/"
        };

        AnalyseDependencies(settings);
    });
...

Settings

The DependenciesAnalyserSettings have one mandatory option from two possible options, Folder and Project.

  • Folder - The addin will recursive scan the folder for csproj and analyse them
  • Project - The addin will analyse the csproj

Built With

  • .NET Core 2.0 - The Framework(s)
  • NuGet - Dependency Management
  • Cake - Cross Platform Build Automation System
  • AppVeyor - Continuous Integration & Delivery Service

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details