/
Directory.Build.Cs.targets
77 lines (59 loc) · 5.06 KB
/
Directory.Build.Cs.targets
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Compile Include="$(CommonAssemblyInfoPath_Cs)" />
</ItemGroup>
<!-- ############################################################################## -->
<!-- Bugfix for temporary Wpf projects. Currently these projects cause problems on -->
<!-- build server when attempting to copy a xml documentation. -->
<!-- ############################################################################## -->
<PropertyGroup>
<DocumentationFile Condition="'$(OmitDocumentationFile)'!='true' And !$([System.Text.RegularExpressions.Regex]::IsMatch('$(MSBuildProjectName)', '.+_wpftmp'))">
$(OutputPath)\$(AssemblyName).xml
</DocumentationFile>
</PropertyGroup>
<!-- ############################################################################## -->
<!-- Check whether important properties were overridden in the project by accident -->
<!-- ############################################################################## -->
<Target Name="CheckForInvalidOverrides" BeforeTargets="Build">
<!-- BaseIntermediateOutputPath -->
<Error
Condition="'$(BaseIntermediateOutputPath)' != '$(BuildVs_BaseIntermediateOutputPath)' and '$(BuildVs_Override_BaseIntermediateOutputPath)' != 'true'"
Text="The property 'BaseIntermediateOutputPath' was overridden by the project (Expected: '$(BuildVs_BaseIntermediateOutputPath)', Actual: '$(BaseIntermediateOutputPath)'). If this was desired, please set the 'BuildVs_Override_BaseIntermediateOutputPath' property to 'true'. Otherwise remove setting the 'BaseIntermediateOutputPath' property from the project file." />
<!-- IntermediateOutputPath -->
<Error
Condition="'$(IntermediateOutputPath)' != '$(BuildVs_IntermediateOutputPath)' and '$(BuildVs_Override_IntermediateOutputPath)' != 'true'"
Text="The property 'IntermediateOutputPath' was overridden by the project (Expected: '$(BuildVs_IntermediateOutputPath)', Actual: '$(IntermediateOutputPath)'). If this was desired, please set the 'BuildVs_Override_IntermediateOutputPath' property to 'true'. Otherwise remove setting the 'IntermediateOutputPath' property from the project file." />
<!-- BaseOutputPath -->
<Error
Condition="'$(BaseOutputPath)' != '$(BuildVs_BaseOutputPath)' and '$(BuildVs_Override_BaseOutputPath)' != 'true'"
Text="The property 'BaseOutputPath' was overridden by the project (Expected: '$(BuildVs_BaseOutputPath)', Actual: '$(BaseOutputPath)'). If this was desired, please set the 'BuildVs_Override_BaseOutputPath' property to 'true'. Otherwise remove setting the 'BaseOutputPath' property from the project file." />
<!-- OutputPath -->
<Error
Condition="'$(OutputPath)' != '$(BuildVs_OutputPath)' and '$(BuildVs_Override_OutputPath)' != 'true'"
Text="The property 'OutputPath' was overridden by the project (Expected: '$(BuildVs_OutputPath)', Actual: '$(OutputPath)'). If this was desired, please set the 'BuildVs_Override_OutputPath' property to 'true'. Otherwise remove setting the 'OutputPath' property from the project file." />
<!-- PlatformTarget -->
<Error
Condition="'$(PlatformTarget)' != '$(BuildVs_PlatformTarget)'"
Text="The property 'PlatformTarget' was overridden by the project (Expected: '$(BuildVs_PlatformTarget)', Actual: '$(PlatformTarget)'). Please remove setting the 'PlatformTarget' property from the project file or set the 'BuildVs_PlatformTarget' property appropriately." />
<!-- DebugSymbols -->
<Error
Condition="'$(DebugSymbols)' != '$(BuildVs_DebugSymbols)'"
Text="The property 'DebugSymbols' was overridden by the project (Expected: '$(BuildVs_DebugSymbols)', Actual: '$(DebugSymbols)'). Please remove setting the 'DebugSymbols' property from the project file or set the 'BuildVs_DebugSymbols' property appropriately." />
<!-- DebugType -->
<Error
Condition="'$(DebugType)' != '$(BuildVs_DebugType)'"
Text="The property 'DebugType' was overridden by the project (Expected: '$(BuildVs_DebugType)', Actual: '$(DebugType)'). Please remove setting the 'DebugType' property from the project file or set the 'BuildVs_DebugType' property appropriately." />
<!-- Optimize -->
<Error
Condition="'$(Optimize)' != '$(BuildVs_Optimize)'"
Text="The property 'Optimize' was overridden by the project (Expected: '$(BuildVs_Optimize)', Actual: '$(Optimize)'). Please remove setting the 'Optimize' property from the project file or set the 'BuildVs_Optimize' property appropriately." />
</Target>
<!-- ############################################################################## -->
<!-- Delete temporary compiler output caused by this bug: -->
<!-- https://github.com/dotnet/wpf/issues/2930 -->
<!-- ############################################################################## -->
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Condition="'$(IsWindows)' == 'true'" Command="FOR /D %%G in ("$(BuildVs_CommonBuildPath)\.out\*_*_wpftmp") DO RMDIR /S /Q "%%~G"" />
</Target>
</Project>