-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathShader.targets
34 lines (27 loc) · 1.18 KB
/
Shader.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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ShaderFile Include="**\*.fx" />
</ItemGroup>
<PropertyGroup>
<!--TODO: Pass path to EasyXnb as CLI argument.-->
<DestinationFolder>Effects</DestinationFolder>
</PropertyGroup>
<Target
Name="BuildShaders"
BeforeTargets="BuildMod"
Inputs="@(ShaderFile)"
Outputs="@(ShaderFile->'$(DestinationFolder)\%(Filename).xnb')">
<Message Importance="normal" Text="Building shaders..." />
<Message Importance="normal" Text="@(ShaderFile) was modified." />
<!--Turns all .fx files into .xnb files.-->
<Exec Command="EasyXnb.exe" WorkingDirectory="Effects\EasyXnb\" />
<!--Only copies .xnb files corresponding to modified .fx files into DestinationFolder.-->
<Copy SourceFiles="@(ShaderFile->'Effects\EasyXnb\%(Filename).xnb')" DestinationFolder="$(DestinationFolder)"/>
<!--Removes intermediate .xnb files from EasyXnb directory.-->
<ItemGroup>
<TemporaryShaderFiles Include="Effects\EasyXnb\*.xnb"/>
</ItemGroup>
<Delete Files="@(TemporaryShaderFiles)" />
<Message Importance="normal" Text="Finished building shaders." />
</Target>
</Project>