Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PackageLicenseExpression in packages built from this repo #312

Closed
KalleOlaviNiemitalo opened this issue Nov 16, 2021 · 1 comment · Fixed by #315
Closed

Use PackageLicenseExpression in packages built from this repo #312

KalleOlaviNiemitalo opened this issue Nov 16, 2021 · 1 comment · Fixed by #315

Comments

@KalleOlaviNiemitalo
Copy link

The SDK packages published from this repo include a LICENSE.txt file, which contains the text of the MIT license:

<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageLicensePath>$(MSBuildThisFileDirectory)$(PackageLicenseFile)</PackageLicensePath>

However, https://docs.microsoft.com/en-us/nuget/reference/nuspec#license recommends that MIT-licensed packages should have <license type="expression">MIT</license> instead of referring to a file. In Directory.Build.targets, that would be <PackageLicenseExpression>MIT</PackageLicenseExpression>. I believe that would let the NuGet Gallery pages for Microsoft.Build.NoTargets and other packages display the text "MIT license", like the page for Microsoft.Extensions.Logging.Abstractions already does.

LICENSE.txt does contain a copyright notice that would not be covered by <license type="expression">MIT</license>:

Copyright (c) Microsoft Corporation. All rights reserved.

However, almost the same copyright notice is already in the copyright element of the generated nuspec, so omitting the copyright notice from the license element seems OK. I believe it comes from the Copyright property that Directory.Build.targets sets:

<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>

@KalleOlaviNiemitalo KalleOlaviNiemitalo changed the title NuGet PackageLicenseExpression Use PackageLicenseExpression in packages built from this repo Nov 16, 2021
@jeffkl
Copy link
Contributor

jeffkl commented Nov 16, 2021

This sounds reasonable, I think when the packages were first published, NuGet did not have the feature of using an license expression. We should update to use this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants