Skip to content

Commit

Permalink
Change reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Mar 25, 2019
1 parent a538d5f commit cea498c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Squidex/Pipeline/Plugins/PluginExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,29 @@
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Squidex.Domain.Apps.Core;
using Squidex.Domain.Apps.Entities;
using Squidex.Domain.Apps.Events;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Log;
using Squidex.Infrastructure.Plugins;
using Squidex.Web;

namespace Squidex.Pipeline.Plugins
{
public static class PluginExtensions
{
private static readonly Type[] SharedTypes =
{
typeof(IPlugin),
typeof(SquidexCoreModel),
typeof(SquidexCoreOperations),
typeof(SquidexEntities),
typeof(SquidexEvents),
typeof(SquidexInfrastructure),
typeof(SquidexWeb)
};

public static IMvcBuilder AddMyPlugins(this IMvcBuilder mvcBuilder, IConfiguration config)
{
var pluginManager = new PluginManager();
Expand Down Expand Up @@ -75,6 +91,11 @@ private static PluginLoader LoadPlugin(string pluginPath)
{
return PluginLoader.CreateFromAssemblyFile(candidate.FullName, PluginLoaderOptions.PreferSharedTypes);
}

if (candidate.Extension.Equals(".json", StringComparison.OrdinalIgnoreCase))
{
return PluginLoader.CreateFromConfigFile(candidate.FullName, SharedTypes);
}
}

return null;
Expand Down

0 comments on commit cea498c

Please sign in to comment.