summaryrefslogtreecommitdiff
path: root/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/SymStore.targets
diff options
context:
space:
mode:
Diffstat (limited to '.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/SymStore.targets')
-rwxr-xr-x.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/SymStore.targets107
1 files changed, 107 insertions, 0 deletions
diff --git a/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/SymStore.targets b/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/SymStore.targets
new file mode 100755
index 0000000000..26bb35d617
--- /dev/null
+++ b/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/SymStore.targets
@@ -0,0 +1,107 @@
+<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
+<Project>
+
+ <PropertyGroup>
+ <_DeployToSymStoreTargetName Condition="'$(TargetFrameworks)' == ''">_InnerDeployToSymStore</_DeployToSymStoreTargetName>
+ <_DeployToSymStoreTargetName Condition="'$(TargetFrameworks)' != ''">_OuterDeployToSymStore</_DeployToSymStoreTargetName>
+ </PropertyGroup>
+
+ <Target Name="DeployToSymStore" AfterTargets="Pack" DependsOnTargets="$(_DeployToSymStoreTargetName)" />
+
+ <Target Name="_OuterDeployToSymStore">
+ <ItemGroup>
+ <_TargetFramework Include="$(TargetFrameworks)" />
+ </ItemGroup>
+ <MSBuild Projects="$(MSBuildProjectFile)"
+ Condition="'$(TargetFrameworks)' != ''"
+ Targets="_InnerDeployToSymStore"
+ Properties="TargetFramework=%(_TargetFramework.Identity)">
+ </MSBuild>
+ </Target>
+
+ <Target Name="_InnerDeployToSymStore">
+ <PropertyGroup>
+ <_TargetPdbPath />
+ <_TargetPdbPath Condition="'$(DebugType)' != 'embedded'">$([System.IO.Path]::ChangeExtension($(TargetPath), '.pdb'))</_TargetPdbPath>
+
+ <_SymStoreOutputDir>$(ArtifactsSymStoreDirectory)$(MSBuildProjectName)\$(TargetFramework)\</_SymStoreOutputDir>
+ <_SymStorePdbPath>$(_SymStoreOutputDir)$(TargetName).pdb</_SymStorePdbPath>
+ <_SymStoreAssemblyPath>$(_SymStoreOutputDir)$(TargetName)$(TargetExt)</_SymStoreAssemblyPath>
+
+ <!-- By default publish Windows PDBs only for shipping components -->
+ <PublishWindowsPdb Condition="'$(PublishWindowsPdb)' == '' and '$(IsShippingAssembly)' == 'true' and Exists('$(TargetPath)') and ('$(DebugType)' == 'embedded' or Exists('$(_TargetPdbPath)'))">true</PublishWindowsPdb>
+ </PropertyGroup>
+ </Target>
+
+ <!--
+ Convert Portable and Embedded PDBs.
+ We publish converted PDBs to Symbol Store so that WinDBG can find them when debugging crash dumps.
+ Convert source link to srcsvr so that both WinDBG and VS can open the source files.
+
+ We add SRC_INDEX=public srcsvr variable in order to preserve the source server stream when
+ it's published to the public symbol server (msdl.microsoft.com).
+ -->
+ <Target Name="_DeployPortableSymbolsToSymStore"
+ AfterTargets="_InnerDeployToSymStore"
+ Inputs="$(TargetPath);$(_TargetPdbPath)"
+ Outputs="$(_SymStorePdbPath)"
+ Condition="'$(PublishWindowsPdb)' == 'true' and ('$(DebugType)' == 'portable' or '$(DebugType)' == 'embedded')">
+
+ <PropertyGroup>
+ <_PdbConverterPath>$(NuGetPackageRoot)microsoft.diasymreader.pdb2pdb\$(MicrosoftDiaSymReaderPdb2PdbVersion)\tools\Pdb2Pdb.exe</_PdbConverterPath>
+ <_PdbConverterCommandLineArgs>"$(TargetPath)" /out "$(_SymStorePdbPath)" /verbose /srcsvrvar SRC_INDEX=public</_PdbConverterCommandLineArgs>
+ </PropertyGroup>
+
+ <Error Text="Attempt to publish Portable PDB to SymStore without conversion: UsingToolPdbConverter property is false in project $(MSBuildProjectName)"
+ Condition="'$(UsingToolPdbConverter)' != 'true'"
+ ContinueOnError="false"/>
+
+ <MakeDir Directories="$(_SymStoreOutputDir)"/>
+
+ <Exec Command='"$(_PdbConverterPath)" $(_PdbConverterCommandLineArgs)' IgnoreExitCode="false" />
+
+ <ItemGroup>
+ <FileWrites Include="$(_SymStorePdbPath)"/>
+ </ItemGroup>
+ </Target>
+
+ <!--
+ The current MicroBuild symbol indexing task doesn't support specifying list of files to index.
+ Therefore we create hardlinks to the files in output directory, where DLLs and EXEs are signed.
+ These targets are executed after the signing phase so that we publish signed binaries to the
+ symbol store even if the files are copies and not hardlinked.
+ -->
+ <Target Name="_DeployWindowsSymbolsToSymStore"
+ AfterTargets="_InnerDeployToSymStore"
+ Condition="'$(PublishWindowsPdb)' == 'true' and ('$(DebugType)' == 'full' or '$(DebugType)' == 'pdbonly')"
+ Inputs="$(_TargetPdbPath)"
+ Outputs="$(_SymStorePdbPath)">
+
+ <MakeDir Directories="$(_SymStoreOutputDir)"/>
+
+ <Copy SourceFiles="$(_TargetPdbPath)"
+ DestinationFiles="$(_SymStorePdbPath)"
+ UseHardlinksIfPossible="true"/>
+
+ <ItemGroup>
+ <FileWrites Include="$(_SymStorePdbPath)"/>
+ </ItemGroup>
+ </Target>
+
+ <Target Name="_DeployAssembliesToSymStore"
+ AfterTargets="_InnerDeployToSymStore"
+ Condition="'$(PublishWindowsPdb)' == 'true' and '$(UsingToolSymbolUploader)' != 'true'"
+ Inputs="$(TargetPath)"
+ Outputs="$(_SymStoreAssemblyPath)">
+
+ <MakeDir Directories="$(_SymStoreOutputDir)"/>
+
+ <Copy SourceFiles="$(TargetPath)"
+ DestinationFiles="$(_SymStoreAssemblyPath)"
+ UseHardlinksIfPossible="true"/>
+
+ <ItemGroup>
+ <FileWrites Include="$(_SymStoreAssemblyPath)"/>
+ </ItemGroup>
+ </Target>
+</Project>