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 to NuGet packages #8464

Merged
merged 2 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,22 @@
<ForceGenerationOfBindingRedirects>true</ForceGenerationOfBindingRedirects>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<!-- TODO: Might be related to: https://github.com/dotnet/project-system/issues/5619 -->
<EnableSourceLink Condition="'$(CIBuild)' == 'true'">true</EnableSourceLink>
<NoWarn>$(NoWarn);NU5125</NoWarn>

<!-- SourceLink properties -->
<!-- https://github.com/dotnet/sourcelink#using-source-link-in-net-projects -->
<EnableSourceLink>true</EnableSourceLink>
<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<!-- Marks the assembly be built in a determinstic way. -->
MiYanni marked this conversation as resolved.
Show resolved Hide resolved
<!-- See: https://github.com/dotnet/sdk/issues/16325#issuecomment-981818164 -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
MiYanni marked this conversation as resolved.
Show resolved Hide resolved

<!-- Test project properties -->
<IsUnitTestProject Condition="'$(IsUnitTestProject)' == ''">false</IsUnitTestProject>
<IsIntegrationTestProject Condition="'$(IsIntegrationTestProject)' == ''">false</IsIntegrationTestProject>
Expand Down
1 change: 1 addition & 0 deletions eng/imports/HostAgnostic.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<PackageReference Include="Microsoft.DiaSymReader.Pdb2Pdb" ExcludeAssets="all" GeneratePathProperty="true" />
<!-- Path Property: PkgCodecov -->
<PackageReference Include="Codecov" ExcludeAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="all" />

<!-- CPS -->
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem" />
Expand Down
1 change: 1 addition & 0 deletions eng/imports/Packages.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PackageReference Update="Microsoft.DiaSymReader.Pdb2Pdb" Version="1.1.0-beta2-22320-02" />
<!-- This package is deprecated. CodecovUploader is now the recommended package. -->
<PackageReference Update="Codecov" Version="1.13.0" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />

<!-- VS SDK -->
<PackageReference Update="EnvDTE" Version="17.0.32112.339" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,4 +627,11 @@
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" />
</ItemGroup>

<!-- This is required for SourceLink to find these .xaml files within the generated .g.cs files. -->
<!-- Note that the filepath for the file MUST be nested within itself in the destination, as the .g.cs files include the relative nested path. -->
<!-- See: https://github.com/dotnet/sourcelink/issues/492 -->
<Target Name="CopyDependentUponXamlFiles" BeforeTargets="CoreCompile">
<Copy SourceFiles="OptionPages\GeneralOptionPageControl.xaml" DestinationFiles="$(IntermediateOutputPath)\OptionPages\OptionPages\GeneralOptionPageControl.xaml" SkipUnchangedFiles="true" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@

<ItemGroup>
<Page Include="ProjectSystem\VS\PropertyPages\DebugPageControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
MiYanni marked this conversation as resolved.
Show resolved Hide resolved
</Page>
<Page Include="ProjectSystem\VS\PropertyPages\GetProfileNameDialog.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -117,4 +117,12 @@
<AdditionalFiles Include="PublicAPI.Unshipped.txt" />
</ItemGroup>

<!-- This is required for SourceLink to find these .xaml files within the generated .g.cs files. -->
<!-- Note that the filepath for the file MUST be nested within itself in the destination, as the .g.cs files include the relative nested path. -->
<!-- See: https://github.com/dotnet/sourcelink/issues/492 -->
<Target Name="CopyDependentUponXamlFiles" BeforeTargets="CoreCompile">
<Copy SourceFiles="ProjectSystem\VS\PropertyPages\DebugPageControl.xaml" DestinationFiles="$(IntermediateOutputPath)\ProjectSystem\VS\PropertyPages\ProjectSystem\VS\PropertyPages\DebugPageControl.xaml" SkipUnchangedFiles="true" />
<Copy SourceFiles="ProjectSystem\VS\PropertyPages\GetProfileNameDialog.xaml" DestinationFiles="$(IntermediateOutputPath)\ProjectSystem\VS\PropertyPages\ProjectSystem\VS\PropertyPages\GetProfileNameDialog.xaml" SkipUnchangedFiles="true" />
</Target>

</Project>