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

Add automatic module name #3897

Merged

Conversation

TheDGOfficial
Copy link
Contributor

@TheDGOfficial TheDGOfficial commented Apr 12, 2021

Description

Adds an automatic module name, that is, used as module name when Skript is on the modulepath on Java 9+.

If the jar is not modular (does not contain module-info.class) and does not have a Automatic-Module-Name entry on META-INF/MANIFEST.MF, then the module name is determined by file name.

Publishing non modular artifacts (not containing module-info.class) that also doesn't contain Automatic-Module-Name to any repository and using them as libraries on projects is discouraged, and will most likely cause a warning to be thrown.

The filename based module name is normally Skript on releases published in GitHub Releases, but people can alter them and name it whatever they want.

Adding an Automatic-Module-Name will break the current modular projects that requiring Skript via its module name derived from file name (i.e. requires Skript; in module-info.java), because in this PR I used ch.njol.skript as module name, so the correct code should be requires ch.njol.skript; after this PR. We can do Automatic-Module-Name: Skript to not break anything and just make it not dependant on file name, but for naming conventions it should be ch.njol.skript.

Note that, this will not change anything on < Java 9 or even Java 9+, on non modular projects.


Target Minecraft Versions: any
Requirements: none
Related Issues: none

@TPGamesNL TPGamesNL added 2.6 enhancement Feature request, an issue about something that could be improved, or a PR improving something. labels Apr 12, 2021
@FranKusmiruk FranKusmiruk merged commit 648d840 into SkriptLang:master Apr 22, 2021
@TheDGOfficial TheDGOfficial deleted the add-automatic-module-name branch April 22, 2021 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants