forked from aki-art/ONI-Mods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
47 lines (41 loc) · 1.78 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
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="WriteToFile" BeforeTargets="Build" Condition="'$(GenerateMetadata)' == 'true'">
<PropertyGroup>
<ModContent>
title: $(ModName)
description: $(ModDescription)
staticID: $(AssemblyName)
</ModContent>
<ModInfoContent>
supportedContent: $(SupportedContent)
minimumSupportedBuild: $(MinimumSupportedBuild)
version: $(FileVersion)
APIVersion: $(APIVersion)
</ModInfoContent>
</PropertyGroup>
<WriteLinesToFile File="$(TargetDir)/mod.yaml" Lines="$(ModContent)" Overwrite="true" />
<WriteLinesToFile File="$(TargetDir)/mod_info.yaml" Lines="$(ModInfoContent)" Overwrite="true" />
</Target>
<Target Name="ILRepack" AfterTargets="Build" Condition="'$(IsPacked)' == 'true'">
<ItemGroup>
<InputAssemblies Include="$(TargetPath)" />
<InputAssemblies
Include="$(TargetDir)\*.dll"
Exclude="**/0Harmony.dll; **/System.*; **/Microsoft.*; **/UnityEngine.*; $(TargetPath)" />
</ItemGroup>
<ILRepack
TargetPlatformVersion="v4"
TargetKind="SameAsPrimaryAssembly"
InputAssemblies="@(InputAssemblies)"
Wildcards="true"
LibraryPath="$(GameLibsFolder)"
Parallel="true"
OutputFile="$(TargetPath)"/>
</Target>
<Target Name="CopyModFiles" AfterTargets="ILRepack" Condition="'$(AssemblyName)' != 'FUtility' and '$(AssemblyName)' != 'FUtilityArt'">
<Exec Command="xcopy /yqsr "$(TargetDir)$(TargetName).dll" "$(ModFolder)\$(TargetName)_dev\""/>
<Exec Command="xcopy /yqsr "$(TargetDir)mod.yaml" "$(ModFolder)\$(TargetName)_dev\""/>
<Exec Command="xcopy /yqsr "$(TargetDir)mod_info.yaml" "$(ModFolder)\$(TargetName)_dev\""/>
</Target>
</Project>