-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
63 lines (49 loc) · 2.94 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
63 lines (49 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<LangVersion>preview</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'" >
<GeneratedFilesRootDir>$([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', 'Generated Files'))</GeneratedFilesRootDir>
<GeneratedFilesDir>$([MSBuild]::NormalizeDirectory('$(GeneratedFilesRootDir)', '$(TargetFramework)'))</GeneratedFilesDir>
</PropertyGroup>
<ItemGroup>
<Compile Remove="$(GeneratedFilesRootDir)**/*.cs" />
<None Include="$(GeneratedFilesRootDir)**/*.cs" />
<Compile Condition="'$(GeneratedFilesDir)' != '$(GeneratedFilesRootDir)'" Include="$(GeneratedFilesDir)*.cs" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Remove="Microsoft.Windows.SDK.NET.Ref" />
<FrameworkReference Remove="Microsoft.Windows.SDK.NET.Ref.Windows" />
<FrameworkReference Remove="Microsoft.Windows.SDK.NET.Ref.Xaml" />
</ItemGroup>
<Import Condition="'$(MSBuildProjectExtension)' == '.csproj' and '$(SimulateCsWinRTNugetReference)' == 'true'" Project="..\nuget\Microsoft.Windows.CsWinRT.targets" />
<Target Name="CsWinRTNet5EOL" />
<Target Name="CsWinRTCheckDependencies" BeforeTargets="PrepareForBuild" Condition="'$(IsDotnetBuild)' != 'true'">
<Error Condition="!Exists('$(SolutionDir)TestWinRT')" Text="This solution requires the TestWinRT repo, which is missing. Please run build.cmd from a Visual Studio command prompt." />
</Target>
<Target Name="CleanIntermediateDirs" Condition="'$(CleanIntermediateDirs)'=='true'" AfterTargets="Build">
<RemoveDir Directories="$(IntDir)" />
</Target>
<!-- For C# projects, we use embedded pdbs, but we still need to submit symbols to the symbol server,
so we extract the pdb to submit. -->
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<PackageReference Include="Microsoft.DiaSymReader.Pdb2Pdb" PrivateAssets="All" GeneratePathProperty="true" />
</ItemGroup>
<Target Name="CopyEmbeddedSymbols"
AfterTargets="Build"
Condition="'$(MSBuildProjectExtension)' == '.csproj' and '$(TargetFramework)' != ''"
Inputs="$(TargetPath)"
Outputs="$(OutputPath)$(AssemblyName).pdb">
<PropertyGroup>
<_Pdb2PdbPath>$(PkgMicrosoft_DiaSymReader_Pdb2Pdb)\tools\Pdb2Pdb.exe</_Pdb2PdbPath>
<_OutputPdbPath>$(OutputPath)$(AssemblyName).pdb</_OutputPdbPath>
<_Pdb2PdbCommandLine>"$(TargetPath)" /out "$(_OutputPdbPath)" /extract</_Pdb2PdbCommandLine>
</PropertyGroup>
<!-- Delete existing extracted PDB to allow overwrite -->
<Delete Files="$(_OutputPdbPath)" Condition="Exists('$(_OutputPdbPath)')" />
<Exec Command=""$(_Pdb2PdbPath)" $(_Pdb2PdbCommandLine)" IgnoreExitCode="false" />
<ItemGroup>
<FileWrites Include="$(_OutputPdbPath)" />
</ItemGroup>
</Target>
</Project>