|
| 1 | +<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="RunPublishSymbols"> |
| 2 | + <PropertyGroup> |
| 3 | + <!-- TFM doesn't matter. These settings are required to make NuGet happy so we can restore required MSBuild packages. --> |
| 4 | + <TargetFramework>netcoreapp3.0</TargetFramework> |
| 5 | + <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> |
| 6 | + <ManifestsPath>artifacts\manifests\</ManifestsPath> |
| 7 | + <DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions> |
| 8 | + |
| 9 | + <!-- Expire symbols after 10 years (or so) by default. --> |
| 10 | + <DotNetSymbolExpirationInDays Condition="'$(DotNetSymbolExpirationInDays)' == ''">3650</DotNetSymbolExpirationInDays> |
| 11 | + </PropertyGroup> |
| 12 | + |
| 13 | + <ItemGroup> |
| 14 | + <PackageReference Include="Microsoft.SymbolUploader.Build.Task" Version="$(MicrosoftSymbolUploaderBuildTaskPackageVersion)" /> |
| 15 | + </ItemGroup> |
| 16 | + |
| 17 | + <!-- |
| 18 | + Initially copied from |
| 19 | + https://github.com/dotnet/core-setup/blob/19390ee14c2824c39db393aff75a95788ececebf/publish/publish.proj#L242-L286 |
| 20 | + --> |
| 21 | + <Target Name="RunPublishSymbols"> |
| 22 | + <ItemGroup> |
| 23 | + <SymbolServerConfig |
| 24 | + Include="MSDL (public symbols server)" |
| 25 | + Url="https://microsoftpublicsymbols.artifacts.visualstudio.com/DefaultCollection" |
| 26 | + Pat="$(MicrosoftSymbolServerPAT)" /> |
| 27 | + |
| 28 | + <SymbolServerConfig |
| 29 | + Include="SymWeb (internal symbols server)" |
| 30 | + Url="https://microsoft.artifacts.visualstudio.com/DefaultCollection" |
| 31 | + Pat="$(SymwebSymbolServerPAT)" /> |
| 32 | + </ItemGroup> |
| 33 | + |
| 34 | + <Error |
| 35 | + Condition="'%(SymbolServerConfig.Pat)' == ''" |
| 36 | + Text="Missing symbol server publish PAT for '%(SymbolServerConfig.Identity)'" /> |
| 37 | + |
| 38 | + <!-- Could also set SymbolDryRun, SymbolExpirationInDays or SymbolVerboseLogging. --> |
| 39 | + <ItemGroup> |
| 40 | + <SymbolServerPublishProject |
| 41 | + Include="$(MSBuildProjectFullPath)" |
| 42 | + AdditionalProperties=" |
| 43 | + SymbolServerDescription=%(SymbolServerConfig.Identity); |
| 44 | + SymbolServerPath=%(SymbolServerConfig.Url); |
| 45 | + SymbolServerPAT=%(SymbolServerConfig.Pat)" /> |
| 46 | + </ItemGroup> |
| 47 | + |
| 48 | + <!-- Note: Can't run in parallel. Symbol publish opens the zips exclusively. --> |
| 49 | + <MSBuild |
| 50 | + Projects="@(SymbolServerPublishProject)" |
| 51 | + Targets="SetupPublishSymbols;PublishSymbols" |
| 52 | + Properties="SymbolDirectory=$(SymbolDirectory)" /> |
| 53 | + </Target> |
| 54 | + |
| 55 | + <Target Name="SetupPublishSymbols"> |
| 56 | + <ItemGroup> |
| 57 | + <SymbolPackagesToPublish Include="$(SymbolDirectory)/**/*.symbols.nupkg" /> |
| 58 | + </ItemGroup> |
| 59 | + |
| 60 | + <Message Importance="High" Text="Publishing symbol packages to '$(SymbolServerDescription)':%0A @(SymbolPackagesToPublish, '%0A ')"/> |
| 61 | + </Target> |
| 62 | +</Project> |
0 commit comments