-
Notifications
You must be signed in to change notification settings - Fork 1
/
ge.targets
62 lines (54 loc) · 3.07 KB
/
ge.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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputDir>$(SolutionDir)output\</OutputDir>
<OutFileSuffix Condition="$(Configuration) == 'Debug'" >_debug</OutFileSuffix>
</PropertyGroup>
<Target Name="PostBuildMacros" BeforeTargets="ILRepack">
<Message Text="[$(ProjectName)]-[PostBuildMacros] configuration: $(Configuration)" Importance="High"/>
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="Targets" />
</GetAssemblyIdentity>
<ItemGroup>
<VersionNumber Include="@(Targets->'%(Version)')" />
</ItemGroup>
</Target>
<Target Name="CleanOutput" BeforeTargets="PreBuildEvent" AfterTargets="ILRepack">
<ItemGroup>
<FilesToDelete Include="$(OutputDir)$(TargetName)" />
</ItemGroup>
<Message Text="[$(ProjectName)]-[CleanOutput] Deleting Files @(FilesToDelete)" Importance="High"/>
<Delete Files="@(FilesToDelete)" />
</Target>
<Target Name="CopyToOutput" AfterTargets="Build">
<ItemGroup>
<LibraryFiles Include="$(TargetDir)\*.dll" Exclude="$(TargetDir)\YawGEAPI.dll" />
</ItemGroup>
<Message Text="[$(ProjectName)]-[CopyToOutput] Copying Files $(OutputDir)$(TargetName)\" Importance="High"/>
<Copy SourceFiles="@(LibraryFiles)" DestinationFolder="$(OutputDir)$(TargetName)\" >
<Output TaskParameter="CopiedFiles" ItemName="CopiedFiles" />
</Copy>
<Message Text="[$(ProjectName)]-[CopyToOutput] Copied @(CopiedFiles->Count()) files" Importance="High" />
</Target>
<Target Name="ILRepack" AfterTargets="CopyToOutput" Condition="'@(CopiedFiles->Count())' > 1" >
<ItemGroup>
<Main Include="$(OutputDir)$(TargetName)\$(TargetFileName)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<MergedFileName Include="$(OutputDir)$(TargetName)_debug.dll" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<MergedFileName Include="$(OutputDir)$(TargetName).dll" />
</ItemGroup>
<ItemGroup>
<Others Include="$(OutputDir)$(TargetName)\*.dll" Exclude="@(Main)" />
</ItemGroup>
<Message Text="[$(ProjectName)]-[ILRepack] out:@(MergedFileName) Main: @(Main) Others: @(Others, ', ')" Importance="High"/>
<Exec Command="ILRepack /out:@(MergedFileName) @(Main) @(Others, ' ')" />
<RemoveDir Directories="$(OutputDir)$(TargetName)" />
</Target>
<Target Name="MoveSingleFile" AfterTargets="CopyToOutput" Condition="'@(CopiedFiles->Count())' == 1">
<Message Text="[$(ProjectName)]-[MoveSingleFile] Moving single file to $(OutputDir)$(TargetName)$(OutFileSuffix).dll" Importance="High"/>
<Copy SourceFiles="$(TargetPath)" DestinationFiles="$(OutputDir)$(TargetName)$(OutFileSuffix).dll" />
<RemoveDir Directories="$(SolutionDir)output\$(TargetName)" />
</Target>
</Project>