Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

SourceLink 3 Plan #305

Closed
ctaggart opened this issue Jan 7, 2018 · 10 comments
Closed

SourceLink 3 Plan #305

ctaggart opened this issue Jan 7, 2018 · 10 comments
Milestone

Comments

@ctaggart
Copy link
Owner

ctaggart commented Jan 7, 2018

SourceLink exists to fill a gap in the .NET tooling. For version 2, much of the functionality was replaced by new .NET tooling that was developed along with .NET Core such as the Portable PDB format and the System.Reflection.Metadata that provides an API to it. For version 3, functionality found in version 2 will also move upstream into the .NET tooling. There will be three layers:

  1. Microsoft.Build.Tasks.RepositoryInfo
    Shipped with MSBuild and available from Microsoft.Common.targets.
  2. source control packages
    Microsoft.Build.Tasks.Git
    Microsoft.Build.Tasks.TFVC
    They may be added via a PackageRefernce
  3. source link packages
    Provide necessary info for specific source control hosts
    SourceLink.GitHub
    SourceLink.VSO.Git
    SourceLink.VSO.TFVC
@ctaggart
Copy link
Owner Author

ctaggart commented Jan 7, 2018

Some open questions:

  • Will the Microsoft.Build.Tasks.Git be able to handle git submodule support? See git submodule support #228.
  • Would it be possible to provide a source control package that provided the source link info for paket github dependencies? Each sourcefile should be an entry in a sourcelink.json.

cc @tmat

@tmat
Copy link
Collaborator

tmat commented Jan 8, 2018

Will the Microsoft.Build.Tasks.Git be able to handle git submodule support?

Yes.

Would it be possible to provide a source control package that provided the source link info for paket github dependencies?

I'm not familiar with packet but it will support source nuget packages. Packet should probably work as well.

@tmat
Copy link
Collaborator

tmat commented Jan 8, 2018

Re source packages:

See e.g. https://dotnet.myget.org/feed/roslyn/package/nuget/Microsoft.CodeAnalysis.Debugging/2.7.0-beta3-62506-01. The package includes build\Microsoft.CodeAnalysis.Debugging.props file that adds a SourceRoot like so:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <SourceRoot Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\contentFiles\cs\$(TargetFramework)\'))"
                RawUrl="https://raw.githubusercontent.com/dotnet/roslyn/5fa5e066eb945b4c91a54ff29c01ca87f310e96b/src/Dependencies/CodeAnalysis.Debugging"
                UniqueName="$(MSBuildThisFileName)"/>
  </ItemGroup>
</Project>

This is not the final form, I need to update Roslyn a bit. It should be something like:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <SourceRoot Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\contentFiles\cs\$(TargetFramework)\'))"
                SourceLinkUrl="https://raw.githubusercontent.com/dotnet/roslyn/5fa5e066eb945b4c91a54ff29c01ca87f310e96b/src/Dependencies/CodeAnalysis.Debugging/*"/>
  </ItemGroup>
</Project>

As long as packet can add SourceRoot it should work.

@ctaggart
Copy link
Owner Author

ctaggart commented Jan 8, 2018

Cool, that should be easy enough to do.

@borrrden
Copy link

Interesting! I don't see Microsoft.Build.Tasks.Git yet, does that mean it will be a new package eventually? Will it continue to function as SourceLink does in terms of what goes into the MSBuild target properties and such?

@tmat
Copy link
Collaborator

tmat commented Jan 16, 2018

@borrrden Yes, it will be a new package. The properties will be different. Currently work in progress: https://github.com/tmat/repository-info/tree/master/docs

@ctaggart
Copy link
Owner Author

https://github.com/dotnet/sourcelink is now available with libraries published on NuGet.

@KZeronimo
Copy link

Will Microsoft be providing the functionality in SourceLink.Embed.AllSourceFiles

@tmat
Copy link
Collaborator

tmat commented Jun 11, 2018

That has been supported since VS 15.6. Specify <EmbedAllSources>true</EmbedAllSources> in your project.

With SourceLink you can also specify <EmbedUntrackedSources>true</EmbedUntrackedSources>.

See https://github.com/dotnet/sourcelink/tree/master/docs#embedallsources

@ctaggart
Copy link
Owner Author

The plan for 3.0 has been broken up into issues and attached to a milestone:
https://github.com/ctaggart/SourceLink/milestone/30

Most functionality is to be replaced by https://github.com/dotnet/sourcelink Microsoft.SourceLink packages. Some utilities to fill in the gaps will remain here. Feedback welcome.

@ctaggart ctaggart added this to the 3.0.0 milestone Jun 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants