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

Rework plugin system #780

Draft
wants to merge 4 commits into
base: dev4
Choose a base branch
from
Draft

Rework plugin system #780

wants to merge 4 commits into from

Conversation

xxDark
Copy link
Collaborator

@xxDark xxDark commented Apr 27, 2024

What's new

Plugin system is now reworked to act as a graph with dependencies.
Each plugin is loaded in its own class loader controlled by plugin manager.
Plugin loaders no longer participate in plugin loading, but only prepare plugins to be loaded.
To load plugins from a directory or any arbitrary source, PluginDiscoverer may be implemented.

TBD

  • Plugin unloading
  • Migrate to JGraphT
  • Load plugins from the directory when Recaf starts. IMO the code to do that should be moved to main class and not be in @PostConstruct with test env hack.
  • Think if we should even have the concept of "startup" plugins. There probably needs work to be done to properly cleanup plugins when they are unloaded.

Copy link

github-actions bot commented Apr 27, 2024

Unit test results

 43 files   - 10   43 suites   - 10   18s ⏱️ -7s
341 tests  - 33  334 ✅  - 34  6 💤 ±0  1 ❌ +1 
363 runs   - 33  356 ✅  - 34  6 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 98b54f8. ± Comparison against base commit 9653c52.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Apr 27, 2024

Codecov Report

Attention: Patch coverage is 56.29139% with 132 lines in your changes are missing coverage. Please review.

Project coverage is 70.11%. Comparing base (9653c52) to head (51902e9).

❗ Current head 51902e9 differs from pull request most recent head 98b54f8. Consider uploading reports for the commit 98b54f8 to get more accurate results

Files Patch % Lines
...tware/coley/recaf/services/plugin/PluginGraph.java 45.20% 34 Missing and 6 partials ⚠️
...ley/recaf/services/plugin/zip/ZipPluginLoader.java 61.53% 20 Missing and 10 partials ⚠️
...y/recaf/services/plugin/PluginClassLoaderImpl.java 33.33% 21 Missing and 3 partials ⚠️
...oley/recaf/services/plugin/zip/ZipArchiveView.java 41.66% 13 Missing and 1 partial ⚠️
...are/coley/recaf/services/plugin/zip/ZipSource.java 53.84% 3 Missing and 3 partials ⚠️
...y/recaf/services/plugin/zip/ZipPreparedPlugin.java 61.53% 5 Missing ⚠️
...ley/recaf/services/plugin/PluginContainerImpl.java 55.55% 4 Missing ⚠️
...oley/recaf/services/plugin/BasicPluginManager.java 80.00% 2 Missing and 1 partial ⚠️
...a/software/coley/recaf/util/io/PathByteSource.java 0.00% 2 Missing ⚠️
...a/software/coley/recaf/plugin/PluginException.java 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##               dev4     #780      +/-   ##
============================================
- Coverage     70.32%   70.11%   -0.21%     
- Complexity     2992     3012      +20     
============================================
  Files           348      352       +4     
  Lines         15607    15763     +156     
  Branches       1776     1799      +23     
============================================
+ Hits          10975    11052      +77     
- Misses         3773     3843      +70     
- Partials        859      868       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant