Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Plugin Loading #39

Merged
merged 11 commits into from
Sep 29, 2021
Merged

Conversation

eiennohito
Copy link
Collaborator

@eiennohito eiennohito commented Sep 27, 2021

Fixes #17 Fixes #19 Fixes #20 Fixes #21 Fixes #24

  • Plugin loading logic is refactored, no repeated code now
  • DSO plugins can now be resolved relative to executable with the syntax: $exe/plugin or relative to the configuration folder $cfg/plugin.
  • It is recommended not to specify platform dependent name parts for DSO plugins: plugin instead of libplugin.so. First name will correctly resolve on Windows/Linux/macOS.
  • Built-in plugins are moved into the main crate, they can be specified in the configuration by their Java names (but that needs checking).

Main design for the rework of plugin loader

We have core logic of plugin loading in a PluginLoader struct which is generic over implementations of PluginCategory trait.
PluginCategory captures plugin category specific logic: providing specific types, configuration extraction, and instantiation of bundled plugins.

PluginLoader is using fully qualified trait call syntax (see previous paragraph before this link). It is required because type inference does not work if T is not present as one of arguments.

@eiennohito
Copy link
Collaborator Author

Need to finish moving plugins into the main package to fix failing tests.

@eiennohito eiennohito changed the title WIP plugin refactor Refactor Plugin Loading Sep 28, 2021
@eiennohito
Copy link
Collaborator Author

This PR also should be squashed, I think.

@eiennohito
Copy link
Collaborator Author

@mh-northlander ready for review & merging

@mh-northlander mh-northlander merged commit 1fd84de into WorksApplications:develop Sep 29, 2021
@eiennohito eiennohito deleted the plugins branch September 29, 2021 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants