Copy build chain from Vintage Storage

This commit is contained in:
zontreck 2025-01-18 01:10:47 -07:00
parent c416e6e5e1
commit f2a23552af
14 changed files with 125 additions and 51 deletions

2
.gitignore vendored
View file

@ -13,6 +13,8 @@
*.user *.user
*.userosscache *.userosscache
*.sln.docstates *.sln.docstates
.game
Releases
# User-specific files (MonoDevelop/Xamarin Studio) # User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs *.userprefs

View file

@ -5,7 +5,7 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CakeBuild", "CakeBuild\CakeBuild.csproj", "{BC68EDF6-C294-4819-B7F4-9EA99B73E69D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CakeBuild", "CakeBuild\CakeBuild.csproj", "{BC68EDF6-C294-4819-B7F4-9EA99B73E69D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModTemplate", "ModTemplate\ModTemplate.csproj", "{CB2100BC-F653-402A-9FBA-EA463C2BD4FC}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AriasServerUtils", "AriasServerUtils\AriasServerUtils.csproj", "{CB2100BC-F653-402A-9FBA-EA463C2BD4FC}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -0,0 +1,50 @@
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Config;
using Vintagestory.API.Server;
namespace ServerUtilities
{
public class ServerUtilities : ModSystem
{
public static string MOD_ID = "ariasserverutils";
/// <summary>
/// Method to register all mod blocks
/// </summary>
/// <param name="api"></param>
private void RegisterBlocks(ICoreAPI api)
{
api.Logger.Notification("Begin registering block classes for Aria's Server Utils...");
api.Logger.Notification("Block Classes have been registered for Aria's Server Utils!");
}
private void RegisterBlockEntities(ICoreAPI api)
{
}
// Called on server and client
public override void Start(ICoreAPI api)
{
api.Logger.Notification(Lang.Get($"{MOD_ID}:start"));
RegisterBlocks(api);
RegisterBlockEntities(api);
}
public override void StartServerSide(ICoreServerAPI api)
{
api.Logger.Notification(Lang.Get($"{MOD_ID}:start"));
}
public override void StartClientSide(ICoreClientAPI api)
{
api.Logger.Notification(Lang.Get($"{MOD_ID}:start"));
}
}
}

View file

@ -8,23 +8,23 @@
<ItemGroup> <ItemGroup>
<Reference Include="VintagestoryAPI"> <Reference Include="VintagestoryAPI">
<HintPath>$(VINTAGE_STORY)/VintagestoryAPI.dll</HintPath> <HintPath>../.game/VintagestoryAPI.dll</HintPath>
<Private>false</Private> <Private>false</Private>
</Reference> </Reference>
<Reference Include="VSSurvivalMod"> <Reference Include="VSSurvivalMod">
<HintPath>$(VINTAGE_STORY)/Mods/VSSurvivalMod.dll</HintPath> <HintPath>../.game/Mods/VSSurvivalMod.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="VSEssentials"> <Reference Include="VSEssentials">
<HintPath>$(VINTAGE_STORY)/Mods/VSEssentials.dll</HintPath> <HintPath>../.game/Mods/VSEssentials.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="VSCreativeMod"> <Reference Include="VSCreativeMod">
<HintPath>$(VINTAGE_STORY)/Mods/VSCreativeMod.dll</HintPath> <HintPath>../.game/Mods/VSCreativeMod.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>$(VINTAGE_STORY)/Lib/Newtonsoft.Json.dll</HintPath> <HintPath>../.game/Lib/Newtonsoft.Json.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1,11 @@
{
"type": "code",
"modid": "ariasserverutils",
"name": "Aria's Server Utilities",
"authors": ["zontreck"],
"description": "A collection of server utilities\n\nBuild Date: 01-17-2025 @ 03:12 PM",
"version": "1.0.0-dev.1",
"dependencies": {
"game": ""
}
}

View file

@ -13,7 +13,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="VintagestoryAPI"> <Reference Include="VintagestoryAPI">
<HintPath>$(VINTAGE_STORY)/VintagestoryAPI.dll</HintPath> <HintPath>../.game/VintagestoryAPI.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -24,7 +24,7 @@ public static class Program
public class BuildContext : FrostingContext public class BuildContext : FrostingContext
{ {
public const string ProjectName = "ModTemplate"; public const string ProjectName = "AriasServerUtils";
public string BuildConfiguration { get; set; } public string BuildConfiguration { get; set; }
public string Version { get; } public string Version { get; }
public string Name { get; } public string Name { get; }

44
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,44 @@
pipeline {
agent any
options {
buildDiscarder (
logRotator (
numToKeepStr: '5'
)
)
}
stages {
stage ("Build & Archive") {
agent {
label 'linux'
}
steps {
sh '''
#!/bin/bash
git submodule update --init --recursive
update_vs_dotgame
chmod +x build.sh
./build.sh
'''
}
post {
always {
archiveArtifacts artifacts: "Releases/*.zip"
cleanWs()
script {
if(env.DISCORD_URL != '') {
discordSend customUsername: 'Jenkins', description: 'NOTICE: This is an automated development build and may not be stable. Use at your own risk.', enableArtifactsList: true, title: 'Arias Server Utils Build Results', webhookURL: env.DISCORD_URL
}
}
}
}
}
}
}

View file

@ -1,26 +0,0 @@
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Config;
using Vintagestory.API.Server;
namespace ModTemplate
{
public class ModTemplateModSystem : ModSystem
{
// Called on server and client
public override void Start(ICoreAPI api)
{
api.Logger.Notification("Hello from template mod: " + Lang.Get("mymodid:hello"));
}
public override void StartServerSide(ICoreServerAPI api)
{
api.Logger.Notification("Hello from template mod server side");
}
public override void StartClientSide(ICoreClientAPI api)
{
api.Logger.Notification("Hello from template mod client side");
}
}
}

View file

@ -1,3 +0,0 @@
{
"hello": "hello world!"
}

View file

@ -1,13 +0,0 @@
{
"type": "code",
"modid": "mymodid",
"name": "My Template Mod",
"authors": [
"Unknown"
],
"description": "To be added",
"version": "1.0.0",
"dependencies": {
"game": ""
}
}

8
runTest Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
rm -rf Releases
./build.sh
vsleep 2
rm -rf Releases/ariasserverutils
.game/Vintagestory --tracelog --addModPath "$(pwd)/Releases" -o modtest
#.game/Vintagestory --tracelog --addModPath "$(pwd)/Releases"