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

Fix error NU5030: The license file 'LICENSE' does not exist in the package. #3

Merged
merged 3 commits into from
Feb 24, 2024

Conversation

dellis1972
Copy link
Contributor

Context https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5030#issue

This has come up with the Assimp repository https://github.com/MonoGame/MonoGame.Library.Assimp.
When the filename of the license file has no extension NuGet reports an error.

error NU5030: The license file 'LICENSE' does not exist in the package.

Even though we have the PackagePath set. According to the error page, the PackagePath in these cases should be empty.

To fix this we need to split out the LicenceName tag into two values so that they can be set independently. So we add LicenceNamePackagePath tag so that we can do so. Existing code should behave the same way.

…ckage.

Context https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5030#issue

When the filename of the license file has no extension
NuGet reports an error.

```
error NU5030: The license file 'LICENSE' does not exist in the package.
```

Even though we have the `PackagePath` set. According
to the error page, the `PackagePath` in these cases
should be empty.

To fix this we need to split out the `LicenceName` tag into
two values so that they can be set independently. So
we add `LicenceNamePackagePath` tag so that we can do so.
Existing code should behave the same way.
@dellis1972 dellis1972 requested a review from harry-cpp February 23, 2024 14:33
Tasks/PublishPackageTask.cs Outdated Show resolved Hide resolved
else
projectData = projectData.Replace("{LicenceName}", "LICENSE");
projectData = projectData.Replace("{LicenceName}", "LICENSE").Replace ("{LicencePackagePath}", "LICENSE");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't LicencePackagePath be set to "" here as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else if (context.PackContext.LicensePath.EndsWith ("LICENSE")) becomes redundant if true so it can be removed.

@harry-cpp harry-cpp merged commit fc36f60 into main Feb 24, 2024
2 checks passed
@dellis1972 dellis1972 deleted the fixlicense branch February 24, 2024 09:17
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 this pull request may close these issues.

2 participants