-
Notifications
You must be signed in to change notification settings - Fork 419
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
Add SourceLink support #534
Conversation
Can someone explain me why the checks failed ? |
📝 This is a PR for #525. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Clement-Jean Thanks for picking up #525 and submitting this PR. 👍
I wonder, how can we test and be sure that this will work (i.e. ready to be merged) without going through the motion of publishing a new package? For example, in the “Using project file” section of “Introducing Source Code Link for NuGet packages”, it says:
If you create your NuGet package directly with a project file, you will need to add a
RepositoryUrl
and aRepositoryType
to the project file to enable this new feature on your package.
We have neither of those at the moment.
I tried it on my nuget, I didnt need to publish a new version of my nuget just need to update the github repository and then it worked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didnt need to publish a new version of my nuget just need to update the github repository and then it worked
Thanks for confirming but I was hoping that there was a more official way and it looks like there is one using the test
command of the sourcelink
tool, so looking all good:
> dotnet tool install --global SourceLink --version 3.0.0
> pack.cmd
> sourcelink test .\dist\morelinq.3.1.0.nupkg
sourcelink test passed: lib/net451/MoreLinq.pdb
sourcelink test passed: lib/netstandard1.0/MoreLinq.pdb
sourcelink test passed: lib/netstandard2.0/MoreLinq.pdb
👍
MoreLinq/MoreLinq.csproj
Outdated
@@ -133,8 +133,15 @@ | |||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> | |||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> | |||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> | |||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> | |||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | |||
<EmbedUntrackedSources>true</EmbedUntrackedSources> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are actually optional but:
- the first one : Include PDB in the built .nupkg
- the second one : Declare that the Repository URL can be published to NuSpec
- the last one : Embed source files that are not tracked by the source control manager to the PDB (only useful if you generate files during the build)
as I didn't really know what to add or not I prefered to use this way. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I was just talking about EmbedUntrackedSources
. I don't think it's needed since there's nothing we generated during build that's not tracked. Can you test without that and see if there's any negative impact or if the sourcelink test
fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem !
remove these two optional sourcelink's options <PublishRepositoryUrl>true</PublishRepositoryUrl> <EmbedUntrackedSources>true</EmbedUntrackedSources>
it works perfectly, because they are options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help with this!
The source link support is added to the csproj file. Once this pull request is accepted we will be able to debug with it.