Maui.Markup
Maui.Markup copied to clipboard
Added source link
Description of Change
This PR will add the Source Link to our package.
Before (1.0.1 on nuget.org):
After (This PR):
As you can see the Source Link is green, and we have the Repository
information now.
Linked Issues
- Related to #92
PR Checklist
- [x] Has a linked Issue, and the Issue has been
approved
(bug) orChampioned
(feature/proposal) - [ ] Has tests (if omitted, state reason in description)
- [ ] Has samples (if omitted, state reason in description)
- [x] Rebased on top of
main
at time of PR - [x] Changes adhere to coding standard
- [ ] Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls/XYZ
Additional information
Hey @pictos! Could you follow up on the CI build errors?
It's happening on both Windows + macOS. I'm also able to reproduce it locally.
error NU5017: Cannot create a package that has no dependencies nor content. [/Users/bramin/GitHub/CommunityToolkit.Maui.Markup/src/CommunityToolkit.Maui.Markup/CommunityToolkit.Maui.Markup.csproj]
@brminnick what's the command that you're using? I tried on my end and everything works on both VS 2022 preview 6 and terminal
Also, from the logs
Successfully created package '/Users/runner/work/1/a/nuget/CommunityToolkit.Maui.Markup.1.0.0-preview1348.nupkg'.
/Users/runner/hostedtoolcache/dotnet/sdk/6.0.302/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(221,5): error NU5017: Cannot create a package that has no dependencies nor content. [/Users/runner/work/1/s/src/CommunityToolkit.Maui.Markup/CommunityToolkit.Maui.Markup.csproj]
looks like the package was created and then an error happens.
I'm able to reproduce it using the same command in the CI Pipeline:
https://github.com/CommunityToolkit/Maui.Markup/blob/10916e1eeaf6ea92b5bd90c83013e3e9ecf3b26b/azure-pipelines.yml#L240
@brminnick I took the time to investigate this issue, and I would say it's something to do with NuGet or the package... And has to do with the version number parameter, like on our YAML on MCT we don't specify the output path, as you can see here
Locally on my mac, I tried this command and it works.
dotnet pack -c Release -p:PackageVersion=1.2.3.4 --output obj/nuget -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
Do think that makes sense to use the same pattern as we use for MCT?
Looking in the www I found this StackOverflow post that could have something to do with it. It says this error is caused by a folder that starts with .
(not sure if it's our case)
Thanks Pedro! Let's double-check with @VladislavAntonyuk and @jfversluis who are more familiar with the NuGet part of this CI/CD process.
Vlad/Gerald - what do you think? Can we edit this dotnet pack
step?
We need to remove it from macOS build and move to Windows build. The output path which is currently specified is used by NuGet publish task. This task exists only in Windows job.
Interesting. It seems to create the nupkg but not the snupkg package. The only thing I can think of is that the pdb files are not created in the pipeline and therefore not picked up when creating the snupkg file resulting in an empty package?
But I also can't reproduce this locally. Maybe some bugged .NET version we're using in the pipeline but not locally?
Edit: on the MCT repo we use version 6.0.300 to build and pack while here we use 6.0.x, so that seems to support my theory on the difference in .NET versions.
Hey @pictos! I figured out that the error was actually a bug that is fixed in .NET 7.0.
I updated our Azure Pipelines YAML file, adding .NET 7.0.x
to the CI pipeline before running dotnet pack
:
- Install .NET 6 SDK
- Install .NET MAUI
- Uses the .NET 6 SDK to install .NET MAUI which ensures we have a stable (non-preview) .NET MAUI build
- Build
CommunityToolkit.Maui.Markup.Sample
- Build
CommunityToolkit.Maui.Markup
+CommunityToolkit.Maui.Maurkup.UnitTests
- Run Unit Tests
- Install .NET 7 SDK
- Used only by
dotnet pack
- Used only by
- Pack NuGet Package
We're still using .NET 6 to build our DLLs, so our output isn't really impacted by installing this preview of .NET 7.
I also downloaded and tested the NuGet package asset from this CI build and it works fine in my .NET MAUI apps:
Dang - never mind.
Doing this causes the .NET MAUI Dependencies to appear:
I'll revert the CI/CD changes
https://github.com/dotnet/sourcelink