Skip to content

Multiple Rescomp extentions with Service Loader#465

Closed
TheRoboZ wants to merge 2 commits into
Stephane-D:masterfrom
TheRoboZ:master
Closed

Multiple Rescomp extentions with Service Loader#465
TheRoboZ wants to merge 2 commits into
Stephane-D:masterfrom
TheRoboZ:master

Conversation

@TheRoboZ
Copy link
Copy Markdown
Contributor

Reissue this with some cleanup.

This is a proposal on implementing advanced support for multiple rescomp extensions, through separate .jar files.
It uses Service Loader (which requires the wrapper class and other changes to avoid class isolation errors at runtime).
On the user side, each extension jar only need 1 additional manifest file (1 line) before compiling.

The implementation skips processor with missing manifests, duplicate processor etc.
I left it quite verbose to make clear what's happening.
If there's a rescomp_ext.jar file, it will default to legacy loading and only use that.

If the service loader is too much, i also left commented a multiple jar folder scan with legacy loading.

While in my tests it all worked well in various cases, this is more a starting point for you to decide how to go on with this.

@werton
Copy link
Copy Markdown
Contributor

werton commented Mar 31, 2026

@Stephane-D , what do you think about this? Describe what solution you think would be better - use a more abstract and complex one with ServiceLoader, or would it be better to make simple scans for all jar files. Or perhaps you would like to see some other improvements? I talked to @TheRoboZ and he doesn’t mind if someone finalizes this pull-request, I think I can try to do that.

@Stephane-D
Copy link
Copy Markdown
Owner

@TheRoboZ @werton Sorry for not having handled that before. To be honest I think the service loader brings too much complexity for what we want here.
I think scanning for all jar files with the original solution (as @TheRoboZ proposed as well) would be simpler and reply to most situations.

@werton
Copy link
Copy Markdown
Contributor

werton commented Apr 1, 2026

@Stephane-D Got it!
@TheRoboZ Do you plan to finalize this PR yourself? If not, I will create a new PR based on this PR with a link to it.

werton added a commit to werton/SGDK that referenced this pull request Apr 3, 2026
ResComp: added support for multiple extensions. The implementation is based on TheRoboZ folders scan implementation Stephane-D#465 (implementation based on ServiceLoader was removed).
ResComp version bumped to 4.0, rescomp.jar has been updated.
Using: the name of the JAR extension file must be in the following format: '[your_extension_name]_ext.jar' (i.e. the file name must end with '_ext.jar').
Stephane-D pushed a commit that referenced this pull request Apr 12, 2026
ResComp: added support for multiple extensions. The implementation is based on TheRoboZ folders scan implementation #465 (implementation based on ServiceLoader was removed).
ResComp version bumped to 4.0, rescomp.jar has been updated.
Using: the name of the JAR extension file must be in the following format: '[your_extension_name]_ext.jar' (i.e. the file name must end with '_ext.jar').
@TheRoboZ
Copy link
Copy Markdown
Contributor Author

Implemented by #479

@TheRoboZ TheRoboZ closed this Apr 13, 2026
TheRoboZ pushed a commit to TheRoboZ/SGDK that referenced this pull request Apr 23, 2026
…) (Stephane-D#479)

ResComp: added support for multiple extensions. The implementation is based on TheRoboZ folders scan implementation Stephane-D#465 (implementation based on ServiceLoader was removed).
ResComp version bumped to 4.0, rescomp.jar has been updated.
Using: the name of the JAR extension file must be in the following format: '[your_extension_name]_ext.jar' (i.e. the file name must end with '_ext.jar').
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants