Skip to content

A .NET tool to generate file with third party legal notices

License

Notifications You must be signed in to change notification settings

bugproof/DotnetThirdPartyNotices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-thirdpartynotices

NuGet NuGet downloads License

bcs

Installation

dotnet tool install -g DotnetThirdPartyNotices

Get started

Go inside the project or solution directory and run:

dotnet-thirdpartynotices

If your project is in a different directory:

dotnet-thirdpartynotices <project directory path>

Options:

  • --output-filename allow to change output filename
  • --copy-to-outdir allow to copy output file to output directory in Release configuration
  • --filter allow to use regex to filter project files
  • --configuration allow to change configuration name (tool uses Release by default)
  • --github-token allow to use GitHub's token

Note that if you use the solution folder and don't use --copy-to-outdir then licenses from all projects will be merged to single file.

How it works

1. Resolve assemblies

It uses MSBuild to resolve assemblies that should land in the publish folder or release folder.

For .NET Core and .NET Standard projects this is done using ComputeFilesToPublish target.

For traditional .NET Framework projects this is done using ResolveAssemblyReferences target

2. Try to find license based on the information from .nuspec or FileVersionInfo

It tries to find .nuspec for those assemblies and attempts to crawl the license content either from licenseUrl or projectUrl.

Crawling from projectUrl currently works only with github.com projectUrls

Crawling from licenseUrl works with github.com, opensource.org and anything with text/plain Content-Type.

If .nuspec cannot be found it tries to guess the license using FileVersionInfo and checking things like product name.

Notice

This tool is experimental and might not work with certain projects.

Sponsor this project

 

Languages