summaryrefslogtreecommitdiff
path: root/src/.nuget/dir.targets
diff options
context:
space:
mode:
Diffstat (limited to 'src/.nuget/dir.targets')
-rw-r--r--src/.nuget/dir.targets88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/.nuget/dir.targets b/src/.nuget/dir.targets
new file mode 100644
index 0000000000..49e550a4b7
--- /dev/null
+++ b/src/.nuget/dir.targets
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+
+ <Target Name="VerifyVCRedist" BeforeTargets="GetSymbolPackageFiles" Condition="'$(_runtimeOSFamily)' == 'win'">
+ <Error Condition="'$(UniversalCRTSDKDir)' == ''" Text="Unable to find VC Redist binaries - check that UniversalCRTSDKDir environment variable is set" />
+ </Target>
+ <!--
+ Finds symbol files and injects them into the package build.
+ -->
+ <Target Name="GetSymbolPackageFiles" BeforeTargets="GetPackageFiles">
+ <ItemGroup Condition="'$(SymbolFileExtension)' != ''">
+ <AdditionalLibPackageExcludes Include="%2A%2A\%2A$(SymbolFileExtension)"/>
+ </ItemGroup>
+
+ <ItemGroup>
+ <AdditionalLibPackageExcludes Include="@(LongNameFile -> '%(TargetPath)')" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <NativeWithSymbolFile Include="@(NativeBinary)">
+ <TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath>
+ </NativeWithSymbolFile>
+ <!-- Using lib/netstandard1.0 here. There is no TFM for this since it is a runtime itself. -->
+ <NativeWithSymbolFile Include="@(ArchitectureSpecificLibFile)">
+ <TargetPath>runtimes/$(PackageTargetRuntime)/lib/netstandard1.0</TargetPath>
+ </NativeWithSymbolFile>
+ <NativeWithSymbolFile Include="@(ArchitectureSpecificToolFile)">
+ <TargetPath>tools</TargetPath>
+ </NativeWithSymbolFile>
+ </ItemGroup>
+
+ <ItemGroup Condition="'$(HasCrossTargetComponents)'=='true'">
+ <NativeWithSymbolFile Include="@(CrossArchitectureSpecificNativeFileAndSymbol)">
+ <TargetPath>runtimes/$(CrossTargetComponentFolder)_$(PackagePlatform)/native</TargetPath>
+ </NativeWithSymbolFile>
+ <NativeWithSymbolFile Include="@(CrossArchitectureSpecificToolFile)">
+ <TargetPath>tools/$(CrossTargetComponentFolder)_$(PackagePlatform)</TargetPath>
+ </NativeWithSymbolFile>
+ </ItemGroup>
+
+ <ItemGroup>
+ <File Include="@(NativeWithSymbolFile)" />
+ <File Include="@(LongNameFile)">
+ <IsSymbolFile>true</IsSymbolFile>
+ </File>
+ </ItemGroup>
+
+ <ItemGroup>
+ <!-- On Windows, trim ".dll" before adding ".pdb". -->
+ <WindowsNativeFile Include="@(NativeWithSymbolFile)"
+ Condition="'%(NativeWithSymbolFile.Extension)'=='.dll' OR '%(NativeWithSymbolFile.Extension)'=='.exe'" />
+ <WindowsSymbolFile Include="@(WindowsNativeFile -> '%(RootDir)%(Directory)PDB\%(Filename).pdb')" />
+
+ <!--
+ Search for all xplat symbol file extensions on every xplat native binary. Some binaries have
+ no ".so" or ".dylib" extension, so we can't tell which convention its symbol files would
+ use. On xplat, the symbol extension is simply appended.
+ -->
+ <NonWindowsNativeFile Include="@(NativeWithSymbolFile)"
+ Exclude="@(WindowsNativeFile)" />
+
+ <NonWindowsSymbolFile Include="@(NonWindowsNativeFile -> '%(Identity)$(SymbolFileExtension)')" />
+
+ <ExistingWindowsSymbolFile Include="@(WindowsSymbolFile)" Condition="Exists('%(Identity)')" />
+ <ExistingNonWindowsSymbolFile Include="@(NonWindowsSymbolFile)" Condition="Exists('%(Identity)') AND '$(SkipPackagingXplatSymbols)'!='true'" />
+
+ <!-- Include all found symbols. -->
+ <File Include="@(ExistingWindowsSymbolFile);@(ExistingNonWindowsSymbolFile)">
+ <IsSymbolFile>true</IsSymbolFile>
+ </File>
+ </ItemGroup>
+
+ <PropertyGroup>
+ <NeedsPlaceholderPdb Condition="'@(ExistingNonWindowsSymbolFile)'!='' AND '@(ExistingWindowsSymbolFile)'==''">true</NeedsPlaceholderPdb>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <File Include="$(MSBuildThisFileDirectory)\_.pdb"
+ Condition="'$(NeedsPlaceholderPdb)'=='true' AND '$(PackageTargetRuntime)'!=''">
+ <TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath>
+ <IsSymbolFile>true</IsSymbolFile>
+ </File>
+ </ItemGroup>
+ </Target>
+
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)\.., dir.targets))\dir.targets" />
+</Project>