More refactorings for 2.1#6
Merged
Merged
Conversation
Member
poikilotherm
commented
May 5, 2026
- Switch plugins to no longer use ServiceLoader, use a custom loader instead. Avoids the problems involved with ServiceLoader always trying to also load any plugins on the core classpath when we're rely only trying to load the plugin
- Docs docs docs
- More tests
For some reason different JDKs seem to generate slightly different messages for non-repeatable annotations ("type" vs "interface"). Removing the word fixes the flakyness.
…Environment` - Extend `LoaderTestEnvironment.Builder` with `addCoreProcessor` to register core annotation processors. - Update `build` method to include core processors during compilation. - Simplify plugin processor setup by directly chaining `withProcessors`.
…vironment` Update `LoaderTestEnvironment` to use the containing directory of the JAR file when packaging a plugin, ensuring compatibility with full directory scanning, as the plugin loader expects a directory.
…n `PluginLoaderIntegrationTest` - Add `name` attribute to `@ParameterizedTest` to improve test case readability when running with varied core and plugin API levels.
…tory loading - Replace `@Test` with `@ParameterizedTest` using `@ValueSource` to improve test coverage for both JAR and directory packaging scenarios. - Wrap plugin loading assertions in a `try-catch` block to provide detailed failure information in case of a `LoaderException`.
- Remove usage of Java's default ServiceLoader for plugin initialization to avoid class loading conflicts. - Introduce `LoaderHelper.loadPluginClass` for custom plugin loading with collision detection and validation. - Update `PluginLoader` to use the custom loader, improving reliability and maintainability.
…niqueness and collision handling - Clarify guarantees of plugin identity and class name uniqueness among loaded plugins. - Add `@apiNote` regarding collision verification responsibility for external plugins.
- Introduce comprehensive documentation for the `io.gdcc.spi.core.loader` package, detailing its responsibility for runtime plugin discovery, validation, and loading. - Highlight key features, such as validation-first design, contract-based loading, and configurable strictness. - Include usage examples and clarify non-supported features like hot reload or legacy plugin compatibility. - Update `PluginLoader` Javadoc with notes on its custom descriptor-based mechanism, emphasizing the transition away from Java SPI.
- Introduce package-level documentation for `processor`, `annotations`, `plugin`, and `descriptor` packages. - Detail annotation-processing support, core SPI contracts, and metadata discovery mechanisms. - Provide examples for plugin implementors and SPI authors, emphasizing descriptor-based discovery over legacy approaches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.