This repository has been archived by the owner on Nov 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathengenious.targets
92 lines (75 loc) · 4.43 KB
/
engenious.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Add EngeniousContentReference to item type selection in Visual Studio -->
<ItemGroup>
<AvailableItemName Include="EngeniousContentReference" />
</ItemGroup>
<!-- Get all Engenious Game Content References and store them in a list -->
<ItemGroup>
<ContentReferences Include="@(EngeniousContentReference)"/>
</ItemGroup>
<!-- This disables the IDE feature that skips executing msbuild in some build situations. -->
<PropertyGroup>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
<Target Name="Prepare">
<PropertyGroup>
<ContentRootDirectory>Content</ContentRootDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<ParentOutputDir>$(ProjectDir)$(ContentRootDirectory)\bin\Debug</ParentOutputDir>
<ParentIntermediateDir>$(ProjectDir)$(ContentRootDirectory)\obj\Debug</ParentIntermediateDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<ParentOutputDir>$(ProjectDir)$(ContentRootDirectory)\bin\Release</ParentOutputDir>
<ParentIntermediateDir>$(ProjectDir)$(ContentRootDirectory)\obj\Release</ParentIntermediateDir>
</PropertyGroup>
<PropertyGroup>
<ContentRootDirectory>Content</ContentRootDirectory>
<EngeniousContentBuilderExe Condition="'$(EngeniousContentBuilderExe)' == ''">$(MSBuildThisFileDirectory)..\tools\net40\ContentTool.exe</EngeniousContentBuilderExe>
<Header>/configuration:$(Configuration) /outputDir:"$(ParentOutputDir)" /intermediateDir:"$(ParentIntermediateDir)" /projectDir:"$(ProjectDir)/" /hidden:true</Header>
<MonoExe Condition=" '$(OS)' != 'Windows_NT' And Exists ('/Library/Frameworks/Mono.framework/Versions/Current/bin/mono') ">/Library/Frameworks/Mono.framework/Versions/Current/bin/mono</MonoExe>
<MonoExe Condition=" '$(OS)' != 'Windows_NT' And Exists ('/usr/local/bin/mono') ">/usr/local/bin/mono</MonoExe>
<MonoExe Condition=" '$(OS)' != 'Windows_NT' And Exists ('/usr/bin/mono') ">/usr/bin/mono</MonoExe>
<MonoExe Condition=" '$(OS)' != 'Windows_NT' And '$(MonoExe)' == '' ">mono</MonoExe>
</PropertyGroup>
<MakeDir Directories="$(ParentIntermediateDir)"/>
<MakeDir Directories="$(ParentOutputDir)"/>
</Target>
<PropertyGroup>
<CleanDependsOn>
$(CleanDependsOn);
CleanContent;
</CleanDependsOn>
<RebuildDependsOn>
$(RebuildDependsOn);
RebuildContent;
</RebuildDependsOn>
</PropertyGroup>
<Target Name="CopyContent" BeforeTargets="BeforeBuild;PreBuildEvent"
DependsOnTargets="Prepare">
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)..\additional\net40\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(AdditionalFiles)" DestinationFolder="$(ProjectDir)\$(OutputPath)\" SkipUnchangedFiles="true" />
</Target>
<Target Name="BuildContent"
BeforeTargets="BeforeBuild;PreBuildEvent"
DependsOnTargets="Prepare">
<!--<Exec Command="chmod +x "$(EngeniousContentBuilderExe)"" Condition=" '$(OS)' == 'Unix' " />-->
<Exec Command="$(MonoExe) "$(EngeniousContentBuilderExe)" /@:"%(ContentReferences.FullPath)" $(Header)"
WorkingDirectory="%(ContentReferences.RootDir)%(ContentReferences.Directory)" Condition="Exists('%(ContentReferences.FullPath)')" />
<ItemGroup>
<ExtraContent Include="$(ParentOutputDir)\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(ExtraContent)" DestinationFolder="$(ProjectDir)\$(OutputPath)\Content\%(RecursiveDir)" SkipUnchangedFiles="true" />
</Target>
<Target Name="CleanContent" BeforeTargets="BeforeClean;Clean" DependsOnTargets="Prepare">
<Exec Command="$(MonoExe) "$(EngeniousContentBuilderExe)" /@:"%(ContentReferences.FullPath)" $(Header) /clean"
WorkingDirectory="%(ContentReferences.RootDir)%(ContentReferences.Directory)" Condition="Exists('%(ContentReferences.FullPath)')" />
</Target>
<Target Name="RebuildContent" BeforeTargets="BeforeRebuild;Rebuild" DependsOnTargets="Prepare">
<Exec Command="$(MonoExe) "$(EngeniousContentBuilderExe)" /@:"%(ContentReferences.FullPath)" $(Header) /rebuild"
WorkingDirectory="%(ContentReferences.RootDir)%(ContentReferences.Directory)" Condition="Exists('%(ContentReferences.FullPath)')" />
</Target>
</Project>