AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.4k stars 289 forks source link

enable sourcelink #758

Closed mdonoughe closed 4 years ago

mdonoughe commented 4 years ago

This enables Source Link information on all compatible projects in the repository. Should it only happen for projects under Source instead?

The Source Link documentation recommends separating the PDBs into symbol packages instead of packaging them in the main nupkg files. That can probably be done in NightlyBuilder by passing an additional parameter to nuget pack and changing the PDB type if you want it.

Related to #746

ilexp commented 4 years ago

I haven't found the time to look into the details SourceLink myself, can you briefly elaborate on what exactly the build props file in this PR does and how it works? Especially since Duality uses hand-edited .nuspec files for its packages that exist outside the msbuild toolchain, I'd like to double-check with you that this works as intended.

This enables Source Link information on all compatible projects in the repository. Should it only happen for projects under Source instead?

Doesn't hurt to have it in all projects I think.

Barsonax commented 4 years ago

Directory.build.props will be implicitly imported I believe. Still not sure how that will work with custom nuspec files though. @mdonoughe did you test this?

mdonoughe commented 4 years ago

When MSBuild builds a project it searches up the directory tree looking for a Directory.Build.props file and a Directory.Build.targets file. The Directory.Build.targets file is added to the beginning of the project, and the Directory.Build.targets file is added to the end.

If I delete all the .cs files in my work area and then launch the program in the debugger I am prompted about downloading the files via Source Link.

devenv_2019-10-03_19-54-05

devenv_2019-10-03_19-54-26

Source Link information is saved into the PDB so it will work as long as the user has or can get the PDBs. The handcrafted nuspec files are distributing the PDBs in the nupkg so the user should already have the PDB and it should just work. Normally now you would create separate symbol packages, but it's not required.

ilexp commented 4 years ago

Great, thanks for the explanation and testing 👍 I'll just go ahead and merge this right away.