Skip to content

Commit

Permalink
add plugin manager
Browse files Browse the repository at this point in the history
  • Loading branch information
yslmyr committed Oct 9, 2024
1 parent 1ffcfe7 commit 5940d94
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# OasisPluginFramework
A plug-in library based on delphi bpl package,and include some base functionality package

A plug-in library based on delphi bpl package,include some base functionality package,also has an IoC container.
4 changes: 3 additions & 1 deletion packages/D12/OasisPluginFramework.dpk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ requires
rtl;

contains
oasis.core.dependency in '..\..\src\DI\oasis.core.dependency.pas';
oasis.core.dependency in '..\..\src\DI\oasis.core.dependency.pas',
oasis.core.appsvrc in '..\..\src\DI\oasis.core.appsvrc.pas',
oasis.core.plugin.manager in '..\..\src\PM\oasis.core.plugin.manager.pas';

end.
2 changes: 2 additions & 0 deletions packages/D12/OasisPluginFramework.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@
</DelphiCompile>
<DCCReference Include="rtl.dcp"/>
<DCCReference Include="..\..\src\DI\oasis.core.dependency.pas"/>
<DCCReference Include="..\..\src\DI\oasis.core.appsvrc.pas"/>
<DCCReference Include="..\..\src\PM\oasis.core.plugin.manager.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
Expand Down
18 changes: 18 additions & 0 deletions src/DI/oasis.core.appsvrc.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
unit oasis.core.appsvrc;

interface

uses
oasis.core.dependency;

type
IAppServiceProvider = interface
['{CBC6750F-7BCB-42AA-9B1B-DFBA1E1DE93E}']
function GetContainer: IDependencyContainer;
property Container: IDependencyContainer read GetContainer;

end;

implementation

end.
29 changes: 29 additions & 0 deletions src/PM/oasis.core.plugin.manager.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
unit oasis.core.plugin.manager;

interface

uses
mormot.core.base,
mormot.core.collections;

type
IOPlugin = interface;

IOPluginManager = interface
['{F7917846-7D71-4040-9A51-2BF77F96F256}']
function LoadFile(const FileName: RawUtf8): IOPlugin;
procedure LoadFiles;
function GetPluginList: IList<IOPlugin>;
property Plugins: IList<IOPlugin> read GetPluginList;


end;

IOPlugin = interface
['{BFC9DFDA-1D20-4C22-AA97-6F0CAACFA82C}']

end;

implementation

end.

0 comments on commit 5940d94

Please sign in to comment.