Skip to content

Gathers license information of MSBuild projects and its dependencies.

License

Notifications You must be signed in to change notification settings

ringwaldK/dotnet-license-gatherer

 
 

Repository files navigation

LicenseGatherer

Build Status Nuget GitHub License

LicenseGatherer provides license information from all transitive NuGet dependencies of your solution.

Limitation

This tool only gathers licenses from projects using the project SDK.

Installation

As global tool

dotnet tool install --global LicenseGatherer

As local tool

dotnet tool install LicenseGatherer

Usage

Usage: LicenseGatherer [options]

Options:
  -p|--path <PATH_TO_PROJECT_OR_SOLUTION>  The path of the project or solution to gather the licenses. A directory can be specified, the value
                                           must end with \, then for a solution in the working directory is searched. (optional)
  -o|--outputpath <OUTPUT_PATH>            The path of the JSON content output. If the no value is specified some information is printed into
                                           the console. (optional)
  -s|--skipdownload                        Skip the download of licenses
  -?|-h|--help                             Show help information

JSON Output

The generated JSON file consists of the following schema:

An array of packages. One package has these properties

Name Type Explanation
PackageReference object An object containing information of the package
LicenseContent string The content of the license
OriginalLicenseLocation string The url of the given license.
DownloadedLicenseLocation string The corrected url of the license. E.g. It replaces the github url with the raw once.
LicenseExpression object The license expression of the package

LicenseExpression

Contains an object of the type NuGet.Packaging.Licenses.NuGetLicense

Name Type Explanation
Identifier string The identifier according to spdx
Plus boolean Signifies whether the plus operator has been specified on this license
IsStandardLicense boolean Signifies whether this is a standard license known by the NuGet APIs
Type integer 0: License, 1: Operator

PackageReference

Name Type Explanation
Name string The name of the package dependency
ResolvedVersion object The runtime version. This value can differ from the version in the configuration

ResolvedVersion

Contains an object of the type NuGet.Versioning.NuGetVersion.

Name Type Explanation
Version string A System.Version representation of the version without metadata or release labels.
IsLegacyVersion boolean True if the NuGetVersion is using legacy behavior.
Revision integer Revision version R (x.y.z.R)
IsSemVer2 boolean Returns true if version is a SemVer 2.0.0 version
OriginalVersion string Returns the original, non-normalized version string.
Major integer Major version X (X.y.z)
Minor integer Minor version Y (x.Y.z)
Patch integer Patch version Z (x.y.Z)
ReleaseLabels array of string A collection of pre-release labels attached to the version.
Release string The full pre-release label for the version.
IsPrerelease boolean True if pre-release labels exist for the version.
HasMetadata boolean True if metadata exists for the version.
Metadata string Build metadata attached to the version.

Contribution

  • Create a fork and make a Pull Request
  • Submit a bug
  • Submit an idea

License

Licensed under MIT

About

Gathers license information of MSBuild projects and its dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%