Skip to content

Use Reflections library rather than Jar class scanning #164

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

TheLimeGlass
Copy link
Contributor

@TheLimeGlass TheLimeGlass commented Apr 13, 2025

Uses Reflections library rather than Jar class scanning.

Not all projects that implement the skript-parser will use Jars.
Using Reflections library also allows developers to define custom url types before skript-parser scans, such as NeoForge using Union URL Type. I need to register Union URL Type to Reflections before skript-parser.

For example Scroll https://github.com/ScrollLang on NeoForge and Fabric have development options to load the build/ classes for injection hotswapping. This allows avoiding the need to restart the Minecraft client for non new method changes.

So skript-parser will throw an exception as there is no source Jar (it's excluded as a library jar in NeoForge);

java.lang.IllegalArgumentException: URI scheme is not "file"
	at java.base/java.io.File.<init>(File.java:423) ~[?:?]
	at MC-BOOTSTRAP/skript.parser.alpha5/io.github.syst3ms.skriptparser.util.FileUtils.getJarFile(FileUtils.java:214) ~[skript-parser-alpha5.jar%23220!/:alpha5]
	at MC-BOOTSTRAP/skript.parser.alpha5/io.github.syst3ms.skriptparser.Parser.init(Parser.java:102) ~[skript-parser-alpha5.jar%23220!/:alpha5]
  • Also adds the ability to define the main root folder for /addon/ scanning in the init method.
  • Needs to use gradleup's shadow plugin to shadow in Reflections library.
  • Bumps Java version from 11 to 17
  • Will bump the gradle version and Java to 21 in another pull request. Current gradle 8.3 can operate up to Java 20.
  • Forced to update the GitHub versions (v4) for actions cache and setup-java as the current ones are removed (v2).

@TheLimeGlass TheLimeGlass marked this pull request as draft April 13, 2025 22:04
@TheLimeGlass TheLimeGlass marked this pull request as ready for review April 13, 2025 22:06
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.

1 participant