ctaggart / SourceLink

Source Code On Demand
MIT License
356 stars 55 forks source link

SourceLink 3 Plan #305

Closed ctaggart closed 6 years ago

ctaggart commented 6 years ago

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 commented 6 years ago

Some open questions:

cc @tmat

tmat commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Cool, that should be easy enough to do.

borrrden commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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

KZeronimo commented 6 years ago

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

tmat commented 6 years ago

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 commented 6 years ago

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.