forked from psyko-gh/psyko-oni-mods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
85 lines (73 loc) · 3.3 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<AssemblySearchPaths>
$(GameFolder);
$(AssemblySearchPaths)
</AssemblySearchPaths>
</PropertyGroup>
<Target Name="AfterResolveReferences" DependsOnTargets="ClearGameFolderCopyLocal" />
<Target Name="ClearGameFolderCopyLocal">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="$(GameFolder)\*" />
</ItemGroup>
</Target>
<Target Name="GenerateYAML" BeforeTargets="Build" Condition="'$(GenerateYAML)' == 'true'">
<GenerateMetadataFiles
OutputPath="$(TargetDir)"
Title="$(ModName)"
Description="$(ModDescription)"
StaticID="$(AssemblyName)"
SupportedContent="$(SupportedContent)"
MinimumSupportedBuild="$(MinimumSupportedBuild)"
Version="$(FileVersion)"
APIVersion="$(APIVersion)"
/>
</Target>
<Target Name="ILRepack" AfterTargets="CopyFilesToOutputDirectory">
<ItemGroup>
<InputAssemblies
Include="$(TargetDir)\*.dll"
Exclude="**/0Harmony.dll; **/System.*; **/Microsoft.*" />
</ItemGroup>
<ILRepack
TargetPlatformVersion="v4"
TargetKind="SameAsPrimaryAssembly"
InputAssemblies="@(InputAssemblies)"
Wildcards="true"
LibraryPath="$(GameFolder)"
Parallel="true"
OutputFile="$(TargetPath)"/>
</Target>
<Target Name="AfterBuild" DependsOnTargets="CopyArtifactsToInstallFolder" />
<Target Name="CopyArtifactsToInstallFolder" Condition="'$(AssemblyName)' != 'OniUtils'">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<InstallFolder>$(ModFolder)\$(ProjectName)</InstallFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<InstallFolder>$(ModFolder)\$(ProjectName)</InstallFolder>
</PropertyGroup>
<ItemGroup>
<AnimFiles Include="$(ProjectDir)\anim\**\*.*" />
<WorldgenFiles Include="$(ProjectDir)\worldgen\**\*.*" />
<ConfigFiles Include="$(ProjectDir)\config\*.*"/>
<YamlFiles Include="$(TargetDir)\*.yaml"/>
<TranslationFiles Include="$(ProjectDir)\translations\*.po"/>
</ItemGroup>
<Copy SourceFiles="@(AnimFiles)"
DestinationFiles="@(AnimFiles->'$(InstallFolder)\anim\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(WorldgenFiles)"
DestinationFiles="@(WorldgenFiles->'$(InstallFolder)\worldgen\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(ConfigFiles)"
DestinationFiles="@(ConfigFiles->'$(InstallFolder)\config\%(Filename)%(Extension)')" />
<Copy SourceFiles="$(TargetPath)"
DestinationFiles="$(InstallFolder)\$(TargetFileName)" />
<Copy SourceFiles="@(YamlFiles)"
DestinationFiles="@(YamlFiles->'$(InstallFolder)\%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(TranslationFiles)"
DestinationFolder="$(InstallFolder)\translations"/>
<Copy Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
SourceFiles="$(TargetDir)\$(TargetName).pdb;$(TargetDir)\$(TargetFileName).mdb"
DestinationFiles="$(InstallFolder)\$(TargetName).pdb;$(InstallFolder)\$(TargetFileName).mdb" />
</Target>
</Project>