Restructure solution layout by module

This commit is contained in:
master
2025-10-28 15:10:40 +02:00
parent 95daa159c4
commit d870da18ce
4103 changed files with 192899 additions and 187024 deletions

View File

@@ -0,0 +1,44 @@
using System;
using System.IO;
using StellaOps.Notify.WebService.Options;
using StellaOps.Plugin.Hosting;
namespace StellaOps.Notify.WebService.Hosting;
internal static class NotifyPluginHostFactory
{
public static PluginHostOptions Build(NotifyWebServiceOptions options, string contentRootPath)
{
ArgumentNullException.ThrowIfNull(options);
ArgumentNullException.ThrowIfNull(contentRootPath);
var hostOptions = new PluginHostOptions
{
BaseDirectory = options.Plugins.BaseDirectory ?? Path.Combine(contentRootPath, ".."),
PluginsDirectory = options.Plugins.Directory ?? Path.Combine("plugins", "notify"),
PrimaryPrefix = "StellaOps.Notify"
};
if (!Path.IsPathRooted(hostOptions.BaseDirectory))
{
hostOptions.BaseDirectory = Path.GetFullPath(Path.Combine(contentRootPath, hostOptions.BaseDirectory));
}
if (!Path.IsPathRooted(hostOptions.PluginsDirectory))
{
hostOptions.PluginsDirectory = Path.Combine(hostOptions.BaseDirectory, hostOptions.PluginsDirectory);
}
foreach (var pattern in options.Plugins.SearchPatterns)
{
hostOptions.SearchPatterns.Add(pattern);
}
foreach (var prefix in options.Plugins.OrderedPlugins)
{
hostOptions.PluginOrder.Add(prefix);
}
return hostOptions;
}
}