Fixing modinfo.json for SRML

This commit is contained in:
Saty 2023-07-07 16:51:05 +02:00
parent 7327368999
commit f38d6a4fed
3 changed files with 11 additions and 51 deletions

View file

@ -496,10 +496,6 @@
</ItemGroup>
<ItemGroup>
<Content Include="Console\Console Commands.txt" />
<Content Include="modinfo.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>modinfo.json</LastGenOutput>
</Content>
<Content Include="Properties\AssemblyInfo.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AssemblyInfo.cs</LastGenOutput>
@ -514,14 +510,11 @@
</Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="modinfo.json">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>modinfo.tt</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="srmultiplayer.dat" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="modinfo.json" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>

View file

@ -1,9 +1,9 @@
{
"id": "srmp",
"name": "Slime Rancher Multiplayer",
"version": "0.0.1510",
"author": "SatyPardus",
"dependencies": [
{
"id": "srmp",
"name": "Slime Rancher Multiplayer",
"version": "0.0.1510",
"author": "SatyPardus",
"dependencies": [
]
}
]
}

View file

@ -1,33 +0,0 @@
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".json" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#
string output = File.ReadAllText("F:/GitHub/srmp-reloaded/SRMP/Properties/AssemblyInfo.cs");
Regex pattern = new Regex("AssemblyVersion\\(\"(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<revision>\\d+)\\.(?<build>\\d+)\"\\)");
MatchCollection matches = pattern.Matches(output);
if( matches.Count == 1 )
{
major = Convert.ToInt32(matches[0].Groups["major"].Value);
minor = Convert.ToInt32(matches[0].Groups["minor"].Value);
build = Convert.ToInt32(matches[0].Groups["build"].Value);
revision = Convert.ToInt32(matches[0].Groups["revision"].Value);
}
#>
{
"id": "srmp",
"name": "Slime Rancher Multiplayer",
"version": "0.0.<#= this.build #>",
"author": "SatyPardus",
"dependencies": [
]
}
<#+
int major = 0;
int minor = 0;
int revision = 0;
int build = 0;
#>