-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectory.Build.targets
67 lines (56 loc) · 3.45 KB
/
Directory.Build.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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="RemoveSupportDirectories" BeforeTargets="Clean">
<RemoveDir Directories="$(OutputPath)lib" />
<RemoveDir Directories="$(OutputPath)shaders" />
</Target>
<PropertyGroup>
<NoNeatenize>_build;$(Product).Core;$(Product)Test.Core</NoNeatenize>
<IsWindowsProject>false</IsWindowsProject>
<IsWindowsProject Condition="$(MSBuildProjectName.Contains('WinForms'))">true</IsWindowsProject>
<IsWindowsProject Condition="$(MSBuildProjectName.Contains('Wpf'))">true</IsWindowsProject>
<IsWindowsProject Condition="$(MSBuildProjectName.Contains('Test.Rendering')) AND $(BuildOS) == 'Windows'">true</IsWindowsProject>
<IsLinuxProject>false</IsLinuxProject>
<IsLinuxProject Condition="$(MSBuildProjectName.Contains('Gtk'))">true</IsLinuxProject>
<IsLinuxProject Condition="$(MSBuildProjectName.Contains('Test.Rendering')) AND $(BuildOS) == 'Linux'">true</IsLinuxProject>
<IsMacProject>false</IsMacProject>
<IsMacProject Condition="$(MSBuildProjectName.Contains('Mac'))">true</IsMacProject>
<IsMacProject Condition="$(MSBuildProjectName.Contains('Test.Rendering')) AND $(BuildOS) == 'macOS'">true</IsMacProject>
</PropertyGroup>
<PropertyGroup>
<RuntimeIdentifier Condition="$(IsWindowsProject)">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(IsLinuxProject)">linux-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(IsMacProject)">osx-x64</RuntimeIdentifier>
</PropertyGroup>
<Target Name="SetNeatenizePath" AfterTargets="Build" BeforeTargets="NeatenizeLibraries">
<PropertyGroup>
<NeatenizePath Condition="$(IsMacProject) AND $(OutputAppPath) != ''">$(OutputAppPath)\Contents\MonoBundle\</NeatenizePath>
<NeatenizePath Condition="!$(IsMacProject) OR $(OutputAppPath) == ''">$(OutputPath)</NeatenizePath>
</PropertyGroup>
</Target>
<!-- The output GUI executables' config files are hideous enough, the least a
build process can do is keep this project's various dependencies organized. In
concert with the App.config files and their 'probing' element's 'privatePath'
parameter, this makes the directory tree cleaner and more presentable. -->
<Target Name="NeatenizeLibraries" AfterTargets="SetNeatenizePath" Condition="!$(NoNeatenize.Contains($(MSBuildProjectName)))">
<ItemGroup>
<Uglies Include="$(NeatenizePath)*" />
<Uglies Remove="$(NeatenizePath)$(AssemblyName).exe" />
<Uglies Remove="$(NeatenizePath)$(AssemblyName).exe.config" />
<Uglies Remove="$(NeatenizePath)$(AssemblyName).pdb" />
<Uglies Remove="$(NeatenizePath)shaders" />
<Uglies Remove="$(NeatenizePath)Xamarin.Mac.dll" />
<Uglies Remove="$(NeatenizePath)Xamarin.Mac.pdb" />
</ItemGroup>
<Move SourceFiles="@(Uglies)" DestinationFolder="$(NeatenizePath)lib" />
</Target>
<PropertyGroup>
<NoCopyShaders>_build</NoCopyShaders>
</PropertyGroup>
<Target Name="CopyShaders" AfterTargets="NeatenizeLibraries" Condition="!$(NoCopyShaders.Contains($(MSBuildProjectName)))">
<ItemGroup>
<Shaders Include="$(TopLevelDirectory)src\shaders\**\*" />
</ItemGroup>
<Copy Condition="$(OutputAppPath) != ''" SourceFiles="@(Shaders)" DestinationFolder="$(OutputAppPath)\Contents\MonoBundle\shaders\%(Shaders.RecursiveDir)"/>
<Copy Condition="$(OutputAppPath) == ''" SourceFiles="@(Shaders)" DestinationFolder="$(OutputPath)\shaders\%(Shaders.RecursiveDir)" />
</Target>
</Project>