forked from maltiez2/vsmod_PlayerModelLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerModelLib.csproj
More file actions
170 lines (153 loc) · 8.47 KB
/
PlayerModelLib.csproj
File metadata and controls
170 lines (153 loc) · 8.47 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<Project Sdk="Microsoft.NET.Sdk">
<!-- Mod info -->
<PropertyGroup>
<ModName>Player Model Library</ModName>
<ModType>code</ModType>
<ModVersion>1.5.0</ModVersion>
<ModId>playermodellib</ModId>
<Description></Description>
<Side>Universal</Side>
<RequiredOnClient>true</RequiredOnClient>
<RequiredOnServer>true</RequiredOnServer>
</PropertyGroup>
<!-- Authors -->
<ItemGroup>
<ModInfoAuthors Include="Maltiez" />
<ModInfoAuthors Include="Caliber" />
</ItemGroup>
<!-- Dependencies -->
<ItemGroup>
<!-- <Dependencies Include="game" Version="*" /> -->
</ItemGroup>
<!-- Project settings -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ImplicitUsings>enable</ImplicitUsings>
<JsonIndent>2</JsonIndent>
<JsonMaxLineLength>200</JsonMaxLineLength>
</PropertyGroup>
<!-- Loading local settings file -->
<Import Project="Properties\localSettings.props" Condition="Exists('Properties\localSettings.props')" />
<!-- Paths -->
<PropertyGroup>
<ProjectDir>$(MSBuildProjectDirectory)</ProjectDir>
<OutputDir>bin\$(Configuration)\Mods</OutputDir>
<OutputPath>$(OutputDir)\$(ModId)</OutputPath>
<GameDirectory>$(VINTAGE_STORY)</GameDirectory>
<AssetsDir>$(ProjectDir)\resources\assets</AssetsDir>
<ModIconFile>$(ProjectDir)\resources\modicon.png</ModIconFile>
<ReleasesDir>$(ProjectDir)\Releases</ReleasesDir>
<ReleaseFile>$(ModId)_$(ModVersion)</ReleaseFile>
<ReleasePath>$(ReleasesDir)\$(ReleaseFile).zip</ReleasePath>
<ReleasePathDev>$(ReleasesDir)\$(ReleaseFile)_dev.zip</ReleasePathDev>
<ExternalLibDir>$(ProjectDir)\external</ExternalLibDir>
<GameDirectory Condition="'$(GameDirectory)' == ''">$(VINTAGE_STORY)</GameDirectory>
<ExternalLibDir>$(ProjectDir)\external</ExternalLibDir>
</PropertyGroup>
<!-- Startup settings -->
<PropertyGroup>
<DataFolder>$(AppData)\$(DataFolderName)</DataFolder>
<AditionalModsFolder>$(AppData)\$(DataFolderName)\Mods</AditionalModsFolder>
<WorldName>test_$(ModId)</WorldName>
<ModDir>$(ProjectDir)\$(OutputDir)</ModDir>
<EnterWorldCommand Condition="'$(EnterWorldOnStartup)' == 'true'">"-o" "$(WorldName)"</EnterWorldCommand>
</PropertyGroup>
<!-- Formatting JSON files -->
<PropertyGroup>
<Scripts>$(ProjectDir)\scripts</Scripts>
<Formatter>$(Scripts)\formatter.ps1</Formatter>
</PropertyGroup>
<ItemGroup>
<AssetsToFormat Include="$(AssetsDir)\$(ModId)\blocktypes" />
<AssetsToFormat Include="$(AssetsDir)\$(ModId)\itemtypes" />
<AssetsToFormat Include="$(AssetsDir)\$(ModId)\patches" />
<AssetsToFormat Include="$(AssetsDir)\$(ModId)\entities" />
<AssetsToFormat Include="$(AssetsDir)\$(ModId)\config\animations" />
<AssetsToFormat Include="$(AssetsDir)\game\itemtypes" />
</ItemGroup>
<!-- References to libraries that are being used in project -->
<ItemGroup>
<Reference Include="$(ExternalLibDir)/**/*.dll" Private="false" />
<!-- ImGui for debug tools (requires ImGui mod installed if you call ImGui methods) -->
<PackageReference Include="VSImGui" Version="0.0.6" />
<!-- Vintage Story libraries -->
<Reference Include="VintagestoryLib" HintPath="$(GameDirectory)/VintagestoryLib.dll" Private="false" />
<Reference Include="VintagestoryAPI" HintPath="$(GameDirectory)/VintagestoryAPI.dll" Private="false" />
<Reference Include="VSSurvivalMod" HintPath="$(GameDirectory)/Mods/VSSurvivalMod.dll" Private="false" />
<Reference Include="VSEssentials" HintPath="$(GameDirectory)/Mods/VSEssentials.dll" Private="false" />
<Reference Include="VSCreativeMod" HintPath="$(GameDirectory)/Mods/VSCreativeMod.dll" Private="false" />
<Reference Include="Newtonsoft.Json" HintPath="$(GameDirectory)/Lib/Newtonsoft.Json.dll" Private="false" />
<Reference Include="0Harmony" HintPath="$(GameDirectory)/Lib/0Harmony.dll" Private="false" />
<Reference Include="protobuf-net" HintPath="$(GameDirectory)/Lib/protobuf-net.dll" Private="false" />
<Reference Include="cairo-sharp" HintPath="$(GameDirectory)/Lib/cairo-sharp.dll" Private="false" />
<Reference Include="JsonDiffPatch" HintPath="$(GameDirectory)/Lib/JsonDiffPatch.dll" Private="false" />
<Reference Include="cairo-sharp" HintPath="$(GameDirectory)/Lib/cairo-sharp.dll" Private="false" />
<Reference Include="Tavis.JsonPatch" HintPath="$(GameDirectory)/Lib/Tavis.JsonPatch.dll" Private="false" />
<Reference Include="SkiaSharp" HintPath="$(GameDirectory)/Lib/SkiaSharp.dll" Private="false" />
<Reference Include="$(GameDirectory)/Lib/OpenTK*.dll" Private="false" />
</ItemGroup>
<!-- Creating local settings file -->
<Target Name="EnsureSettingsJson" BeforeTargets="ModInfo" Condition="!Exists('Properties\localSettings.props')">
<MakeDir Directories="Properties" />
<WriteLinesToFile File="Properties\localSettings.props" Overwrite="true" Lines="<Project>
 <PropertyGroup>
 <RunFormatter>false</RunFormatter>
 <DataFolderName>VintagestoryData</DataFolderName>
 <GameDirectory></GameDirectory>
 <PackageDevBuild>false</PackageDevBuild>
 <EnterWorldOnStartup>false</EnterWorldOnStartup>
 </PropertyGroup>
</Project>" />
<Error Text="Local settings file was missing, generated a new one. Run build again." />
</Target>
<!-- Forces rebuild -->
<Target Name="ForceRebuild" BeforeTargets="BeforeBuild">
<Touch Files="@(Compile)" AlwaysCreate="true" />
</Target>
<!-- Creates/updates modinfo.json file in build directory -->
<Target Name="ModInfo" BeforeTargets="CopyFilesToOutput">
<PropertyGroup>
<ModInfo>
{
"type": "$(ModType)",
"name": "$(ModName)",
"modid": "$(ModId)",
"version": "$(ModVersion)",
"description": "$(Description)",
"authors": [ @(ModInfoAuthors->'"%(Identity)"', ', ') ],
"dependencies": {
@(Dependencies->'"%(Identity)": "%(Version)"', ', ')
},
"side" : "$(Side)",
"requiredOnClient": $(RequiredOnClient),
"requiredOnServer": $(RequiredOnServer)
}
</ModInfo>
</PropertyGroup>
<!-- Remove all folders in output directory to get rid of builds from bullseye branch -->
<RemoveDir Directories="$(OutputDir)" />
<Message Text="Generating modinfo.json" Importance="high" />
<WriteLinesToFile File="$(OutputPath)/modinfo.json" Lines="$(ModInfo)" Overwrite="true" WriteOnlyWhenDifferent="true" />
</Target>
<!-- Formats asssets files -->
<Target Name="Format" AfterTargets="ModInfo" BeforeTargets="CopyFilesToOutput">
<Exec Condition="'$(OS)' == 'Windows_NT' and '$(RunFormatter)' == 'true'" Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(Formatter)" -Path "%(AssetsToFormat.Identity)" -Indent $(JsonIndent) -MaxLength $(JsonMaxLineLength)" />
</Target>
<!-- Copies modicon, assets folder and native libraries if they exist into output directory -->
<Target Name="CopyFilesToOutput" AfterTargets="Format" BeforeTargets="BeforeBuild">
<RemoveDir Directories="$(OutputPath)assets" />
<Copy SourceFiles="$(ModIconFile)" DestinationFolder="$(OutputPath)" Condition="Exists('$(ModIconFile)')" />
<!-- Windows symlink -->
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="mklink /D "$(OutputPath)assets" "$(ProjectDir)\resources\assets"" />
<!-- Linux/macOS symlink -->
<Exec Condition="'$(OS)' != 'Windows_NT'" Command="ln -s "$(OutputPath)/assets" "$(ProjectDir)/resources/assets"" />
</Target>
<!-- Archives output directory into zip and puts it into Releases folder -->
<Target Name="ZipFiles" AfterTargets="Build" Condition=" '$(Configuration)' == 'Release' ">
<Message Text="Pachaging into '$(ReleaseFile)'" Importance="high" />
<MakeDir Directories="$(ReleasesDir)" />
<Delete Files="$(ReleasePath)" />
<ZipDirectory SourceDirectory="$(OutputPath)" DestinationFile="$(ReleasePath)" />
</Target>
<Target Name="ZipFilesDev" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' and '$(PackageDevBuild)' == 'true'">
<Message Text="Pachaging into '$(ReleaseFile)'" Importance="high" />
<MakeDir Directories="$(ReleasesDir)" />
<Delete Files="$(ReleasePathDev)" />
<ZipDirectory SourceDirectory="$(OutputPath)" DestinationFile="$(ReleasePathDev)" />
</Target>
</Project>