Switched to SimplePlugin plugin loader
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
using MoonCore.PluginFramework;
|
||||
using Moonlight.Frontend.Startup;
|
||||
|
||||
namespace Moonlight.Frontend.Host;
|
||||
|
||||
[PluginLoader]
|
||||
public partial class AppStartupLoader : IAppStartup
|
||||
{
|
||||
|
||||
}
|
||||
@@ -14,8 +14,8 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.1"/>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.1" PrivateAssets="all"/>
|
||||
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.9"/>
|
||||
<PackageReference Include="MoonCore.PluginFramework.Generator" Version="1.0.3"/>
|
||||
<PackageReference Include="SimplePlugin" Version="1.0.2" />
|
||||
<PackageReference Include="SimplePlugin.Abstractions" Version="1.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Moonlight.Frontend.Host;
|
||||
using Moonlight.Frontend.Startup;
|
||||
using SimplePlugin.Generated;
|
||||
|
||||
var appLoader = new AppStartupLoader();
|
||||
appLoader.Initialize();
|
||||
var modules = PluginRegistry
|
||||
.Modules
|
||||
.OfType<IAppStartup>()
|
||||
.ToArray();
|
||||
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
|
||||
appLoader.PreBuild(builder);
|
||||
foreach (var startup in modules)
|
||||
startup.PreBuild(builder);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
appLoader.PostBuild(app);
|
||||
foreach(var startup in modules)
|
||||
startup.PostBuild(app);
|
||||
|
||||
await app.RunAsync();
|
||||
Reference in New Issue
Block a user