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

Add SourceLink support #534

Merged
merged 5 commits into from
Sep 28, 2018
Merged

Add SourceLink support #534

merged 5 commits into from
Sep 28, 2018

Conversation

Clement-Jean
Copy link
Contributor

The source link support is added to the csproj file. Once this pull request is accepted we will be able to debug with it.

@Clement-Jean
Copy link
Contributor Author

Can someone explain me why the checks failed ?

MoreLinq/MoreLinq.csproj Outdated Show resolved Hide resolved
@atifaziz
Copy link
Member

📝 This is a PR for #525.

@atifaziz atifaziz changed the title add sourcelink support Add SourceLink support Sep 28, 2018
Copy link
Member

@atifaziz atifaziz left a 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 a RepositoryType to the project file to enable this new feature on your package.

We have neither of those at the moment.

@Clement-Jean
Copy link
Contributor Author

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

Copy link
Member

@atifaziz atifaziz left a 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

👍

@@ -133,8 +133,15 @@
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Contributor Author

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?

Copy link
Member

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?

Copy link
Contributor Author

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>
@Clement-Jean
Copy link
Contributor Author

it works perfectly, because they are options

Copy link
Member

@atifaziz atifaziz left a 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!

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