-
Notifications
You must be signed in to change notification settings - Fork 65
/
Directory.Build.targets
119 lines (108 loc) · 5.98 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Target Name="SetPlatform" BeforeTargets="CoreCompile">
<PropertyGroup>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
</Target>
<Target Name="Publicize" AfterTargets="Clean" Condition=" '$(UsePublicized)' == 'true' ">
<Publicise InputAssemblies="@(PubliciseInputAssemblies)" OutputPath="../public-lib/"/>
</Target>
<Target Name="GenerateRefAssemblies" AfterTargets="Clean" Condition=" '$(MSBuildProjectName)' == 'PLib' And '$(GameFolderActive)' != '../Lib' ">
<Exec Command="Refasmer -v -O ../Lib --all -c ../public-lib/Assembly-CSharp_public.dll ../public-lib/Assembly-CSharp-firstpass_public.dll ^
$(GameFolderActive)/Assembly-CSharp.dll $(GameFolderActive)/Assembly-CSharp-firstpass.dll $(GameFolderActive)/0Harmony.dll ^
$(GameFolderActive)/FMODUnity.dll $(GameFolderActive)/Newtonsoft.Json.dll $(GameFolderActive)/UnityEngine.dll ^
$(GameFolderActive)/UnityEngine.CoreModule.dll $(GameFolderActive)/UnityEngine.ImageConversionModule.dll ^
$(GameFolderActive)/UnityEngine.InputLegacyModule.dll $(GameFolderActive)/Unity.TextMeshPro.dll ^
$(GameFolderActive)/UnityEngine.TextRenderingModule.dll $(GameFolderActive)/UnityEngine.UI.dll ^
$(GameFolderActive)/UnityEngine.UIModule.dll $(GameFolderActive)/UnityEngine.UnityWebRequestModule.dll ^
$(GameFolderActive)/Ionic.Zip.dll $(GameFolderActive)/Newtonsoft.Json.dll $(GameFolderActive)/com.rlabrecque.steamworks.net.dll"
IgnoreExitCode="true"/>
</Target>
<Target Name="PLibTranslationEmbeddedResources" BeforeTargets="ResolveReferences" Condition=" '$(AssemblyName)' == 'PLibCore' ">
<ItemGroup>
<PLibTranslationFiles Include="../PLibCore/translations/*.po" />
<EmbeddedResource Include="%(PLibTranslationFiles.Identity)"
LogicalName="PeterHan.PLib.Core.PLibStrings.%(PLibTranslationFiles.Filename)%(PLibTranslationFiles.Extension)" />
</ItemGroup>
</Target>
<Target Name="ClearGameFolderCopyLocal" AfterTargets="ResolveAssemblyReferences">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="$(GameFolderActive)\*" />
</ItemGroup>
</Target>
<Target Name="WriteModInfoFile" BeforeTargets="PreBuildEvent" Condition=" '$(DistributeMod)' == 'true' ">
<PropertyGroup>
<ModInfoFile>$(IntermediateOutputPath)\mod_info.yaml</ModInfoFile>
<ModInfoFileContent>
supportedContent: $(SupportedContent)
minimumSupportedBuild: $(LastWorkingBuild)
version: $(FileVersion)
APIVersion: $(APIVersion)
</ModInfoFileContent>
</PropertyGroup>
<WriteLinesToFile File="$(ModInfoFile)" Overwrite="true" Lines="$(ModInfoFileContent)"/>
</Target>
<Target Name="WriteModDescriptionFile" BeforeTargets="PreBuildEvent" Condition=" '$(DistributeMod)' == 'true' ">
<PropertyGroup>
<ModDescriptionFile>$(IntermediateOutputPath)\mod.yaml</ModDescriptionFile>
<ModDescriptionFileContent>
title: "$(AssemblyTitle)"
description: "$(Description)"
staticID: PeterHan.$(AssemblyName)
</ModDescriptionFileContent>
</PropertyGroup>
<WriteLinesToFile File="$(ModDescriptionFile)" Overwrite="true" Lines="$(ModDescriptionFileContent)"/>
</Target>
<Target Name="ILRepack" AfterTargets="Build" Condition=" '$(PLibCore)' != 'true' ">
<PropertyGroup Condition=" '$(AssemblyName)' == 'PLib' ">
<Internalize>false</Internalize>
</PropertyGroup>
<PropertyGroup Condition=" '$(AssemblyName)' != 'PLib' ">
<Internalize>true</Internalize>
</PropertyGroup>
<ItemGroup Condition=" '$(UsesPLib)' != 'false' Or '$(AssemblyName)' == 'PLib' ">
<InputAssemblies Include="$(TargetPath)" />
<InputAssemblies Include="$(TargetDir)PLib*.dll" />
</ItemGroup>
<ItemGroup Condition=" '$(UsesPLib)' == 'false' ">
<InputAssemblies Include="$(TargetPath)" />
</ItemGroup>
<ILRepack
TargetPlatformVersion="v4"
TargetKind="SameAsPrimaryAssembly"
OutputFile="$(TargetPath)"
InputAssemblies="@(InputAssemblies)"
XmlDocumentation="true"
Internalize="$(Internalize)"
Wildcards="true"
LibraryPath="$(GameFolderActive)" />
</Target>
<Target Name="CopyArtifactsToInstallFolder" AfterTargets="ILRepack" Condition=" '$(DistributeMod)' == 'true' ">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<RootInstallFolder>..\Release\$(ProjectName)</RootInstallFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<RootInstallFolder>$(ModFolder)\$(ProjectName)</RootInstallFolder>
</PropertyGroup>
<PropertyGroup>
<InstallFolder>$(RootInstallFolder)$(ArchivedVersionPath)</InstallFolder>
</PropertyGroup>
<ItemGroup>
<AnimFiles Include="$(ProjectDir)\anim\**\*.*" />
<TranslationFiles Include="$(ProjectDir)\translations\*.po" />
<WorldGenFiles Include="$(ProjectDir)\worldgen\**\*.*" />
<WorldGenTemplates Include="$(ProjectDir)\templates\**\*.*" />
<YamlFiles Include="$(ProjectDir)\*.yaml" />
</ItemGroup>
<Copy SourceFiles="@(AnimFiles)" DestinationFiles="@(AnimFiles->'$(InstallFolder)\anim\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(TranslationFiles)" DestinationFolder="$(InstallFolder)\translations" />
<Copy SourceFiles="@(WorldGenFiles)" DestinationFiles="@(WorldGenFiles->'$(InstallFolder)\worldgen\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(WorldGenTemplates)" DestinationFiles="@(WorldGenTemplates->'$(InstallFolder)\templates\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(YamlFiles)" DestinationFolder="$(InstallFolder)" />
<Copy SourceFiles="$(ModInfoFile)" DestinationFolder="$(InstallFolder)" />
<Copy SourceFiles="$(ModDescriptionFile)" DestinationFolder="$(RootInstallFolder)" />
<Copy SourceFiles="$(ProjectDir)\Preview.png" DestinationFiles="$(InstallFolder)\preview.png" Condition=" $(CopyPreview) == true " />
<Copy SourceFiles="$(TargetPath)" DestinationFiles="$(InstallFolder)\$(TargetFileName)" />
</Target>
</Project>