Add task that generates .props file with SourceLink info for a source package
- Dominant language
- C#
- Stars
- 1.4k
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
To provide SourceLink information for a source package to the project that references such package one can write a task that generates .props file below and include it in the `build` directory of the source package (the below example is from [Microsoft.CodeAnalysis.PooledObjects](https://dotnet.myget.org/feed/roslyn/package/nuget/Microsoft.CodeAnalysis.PooledObjects) package):
```xml
```
The target in Roslyn repository that generates the above props is:
```xml
<_RelativePath>$([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectDirectory)))
<_RawUrl>$(RepositoryRawUrl)/$(GitHeadSha)/$(_RelativePath.Replace('\', '/'))/*
<_Content>
]]>
```
Generalize this target to a build task and expose it from Microsoft.SourceLink.Common package.
To complete the end-to-end scenario we would want to also have NuGet Pack support for source packages. Then we could integrate the above task into the build system automatically when Microsoft.SourceLink.* package is referenced.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.