Update Directory.build.props to mirror .NET team practices (#5097)

* Update D.b.p to match .NET teeam patterns

* Make official builds release builds

* Update per feedback

* Update per feedback

* Add embedded as default PDB type

* Add more context

* Rename file per feedback

* Update package
This commit is contained in:
Rich Lander 2020-08-26 20:51:56 -07:00 committed by GitHub
parent 841ba67088
commit a996f36117
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 14 deletions

View file

@ -0,0 +1,40 @@
<Project>
<!--
This file is intended as a best practice for using sourcelink.
https://github.com/dotnet/sourcelink
At Microsoft, we have three build types:
Official build:
- OfficialBuild property is set to true (this is an adhoc property)
- ContinuousIntegrationBuild property is set to true
- Produces authenticode signed binaries, unique version numbers, packages published to feeds, symbols published to symbol servers
- Produces standalone Portable PDBs to reduce the size of the binaries.
PR validation build:
- ContinuousIntegrationBuild property is set to true
- Embeds PDBs to make it easier to debug crash dumps captured on the CI machine.
Developer build:
- Embeds PDBs to be consistent with PR validation build.
Context:
* https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props
* https://github.com/dotnet/sourcelink/tree/master/docs#continuousintegrationbuild
-->
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>embedded</DebugType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<PropertyGroup Condition="'$(OfficialBuild)' == 'true'">
<Configuration>release</Configuration>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<DebugType>portable</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" PrivateAssets="All"/>
</ItemGroup>
</Project>

View file

@ -1,14 +0,0 @@
<Project>
<PropertyGroup Condition="'$(ContinuousIntegrationBuild)'=='true'">
<Configuration>release</Configuration>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>embedded</DebugType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup Condition="'$(ContinuousIntegrationBuild)'=='true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>
</Project>