Closed Barsonax closed 4 years ago
Wait, didn't that work in the past? What caused it to break?
Edit: Old issue for reference: #746
idk but iam not seeing this in the nuspecs in the source nor in the nuspecs of the downloaded nuget package from nuget. Haven't tested it in visual studio but without this sourcelink shouldnt be able to figure out the source code because the data is simply not there.
https://github.com/AdamsLair/duality/pull/758 only added a build.props file. It didnt changed anything about the build itself so how did this ever work?
I believe the required metadata will end up in the .pdb
files, and which repository is used was pulled dynamically from the git repo that was being built. And I guess the build props that were added extend the build process to do that?
Maybe I'm imagining things, but I think I have seen this working in a regular Duality install when looking into the post-PR fix. Just try to debug-step into Duality from a game plugin, or at least that's how I remember testing it.
Just verified this with a fresh Duality install, works fine. I get the VS popup asking whether I want to download the source code to step into, and then I can do just that.
Inspected the pdb in the nuget package:
so ye it seems to end up in the pdb itself.
Now iam wondering why it adds the git metadata in the nuspec with dotnet tooling.
Anyway seems I was wrong in assuming that is was broken based purely on the missing git metadata in the nuspec.
EDIT: https://github.com/dotnet/sourcelink#prerequisites-for-net-projects seems to sort of imply its a optional feature?
closing this as it turns out to be working properly
Summary
Sourcelink as its implemented now does not work in duality. One missing thing that is needed is that the repository link is included in the nuspec and also the commit hash so that sourcelink knows how to find the source code.
The repository link and hash look entry in the nuspec should look like this (taken from https://www.nuget.org/packages/Singularity/0.17.5):
Instructions can be found here https://github.com/dotnet/sourcelink
There might be more missing. It might be easier to add the required entries and use dotnet pack which should handle things like adding the commit hash to the package.