Add instruction to get API DLL archived

This commit is contained in:
zontreck 2024-12-18 03:24:59 -07:00
parent 9aef10ee3f
commit f3d9147c22
4 changed files with 54 additions and 0 deletions

View file

@ -10,6 +10,11 @@ public class PluginSystem
public static List<PluginContainer> Plugins = new List<PluginContainer>();
private static void PSysLog(string Message)
{
Console.WriteLine($"[PLUGINS] {Message}");
}
public static void InitializeSystem(string pluginDirectory)
{
CompoundTag pluginsData = new CompoundTag();
@ -38,11 +43,14 @@ public class PluginSystem
plugin.Initialize();
nPlugin.plugin = plugin;
ForgeCorePluginAttribute attrib = types.GetCustomAttribute<ForgeCorePluginAttribute>();
Tag? pluginStore = pluginsData.Get(attrib.pluginName);
nPlugin.pluginName = attrib.pluginName;
PSysLog($"> Loading plugin: {nPlugin.pluginName}");
if (pluginStore == null)
{
@ -54,15 +62,19 @@ public class PluginSystem
CompoundTag dataTag = tag["data"] as CompoundTag;
plugin.LoadConfig(dataTag);
PSysLog($"> Loaded plugin: {nPlugin.pluginName}");
if (NbtUtils.ReadBoolean(tag, "enabled"))
{
nPlugin.enabled = true;
plugin.Enable();
PSysLog($"> Enabled plugin: {nPlugin.pluginName}");
}
else
{
plugin.Disable();
nPlugin.enabled = false;
PSysLog($"> Disabled plugin: {nPlugin.pluginName}");
}
}

27
Jenkinsfile vendored
View file

@ -33,6 +33,33 @@ pipeline {
}
}
stage("Build API DLL") {
agent {
label 'linux'
}
steps {
script {
sh '''
cd ForgeCoreAPI
dotnet new sln -n ForgeCoreAPI
dotnet sln ForgeCoreAPI.sln add ForgeCoreAPI.csproj
dotnet build -c Release
'''
}
}
post {
always {
archiveArtifacts artifacts: "ForgeCoreAPI/bin/Release/net8.0/ForgeCoreAPI.dll"
cleanWs()
}
}
}
stage("Build on Windows") {
agent {
label 'windows'

View file

@ -9,6 +9,19 @@ dotnet restore
dotnet publish ForgeCore.csproj --nologo -c Release --self-contained true /p:PublishSingleFile=true
cp bin/Release/net8.0/linux-x64/publish/ForgeCore run/
# Create the API DLL
cd ForgeCoreAPI
dotnet new sln -n ForgeCoreAPI
dotnet sln ForgeCoreAPI.sln add ForgeCoreAPI.csproj
dotnet build -c Release
cp bin/Release/net8.0/ForgeCoreAPI.dll ../run/
rm ForgeCoreAPI.sln
cd ..
cd run

2
test
View file

@ -7,6 +7,8 @@ cd run
wget https://ci.zontreck.com/job/Projects/job/CSharp/job/ForgeCore/job/master/lastSuccessfulBuild/artifact/bin/Release/net8.0/linux-x64/publish/ForgeCore
wget https://ci.zontreck.com/job/Projects/job/CSharp/job/ForgeCore/job/master/lastSuccessfulBuild/artifact/ForgeCoreAPI/bin/Release/net8.0/ForgeCoreAPI.dll
chmod +x ForgeCore
./ForgeCore --version
./ForgeCore --help