-
Notifications
You must be signed in to change notification settings - Fork 467
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
Create Platform Shaded Jars #881
Comments
Java's "build once, run everywhere" in shambles. |
it cuts the jar size by quite a bit iirc |
But aren't JavaFX dependencies downloaded for the platform later on anyway? Using the launcher and even back then in 2x/3x versions. |
For context, the current plan is to provide the base jar with no JavaFX and either:
I don't follow this logic. FX is not in the jar, so why would platform-shading lower the size? The resulting jar would be bigger because it has shaded content in it, right?
I'm still salty that the JavaFX artifacts have native library path conflicts between platform classified artifacts.... LWJGL figured this out ages ago. If it weren't for that, a single fat-jar could work. You can still fat-jar now, but you'll have a build that wont link to certain supported systems just because of this shading problem. |
if that's the goal, then maybe add like a
it's not? because the jar I have from the AUR includes javafx, though I'm a few versions out of date.
afaik you can build it in a way that works for all platforms? |
huh, they are? I had a friend who downloaded the latest jar from CI, and got this error:
though, this class did exist in the jar of the version I built from the AUR -git package, so dunno. (but, again, many commits out of date) |
Does AUR package even use 4.x version? Likely not. If the version is 2.x, then it is EoL. |
The launcher is separate. Here we only publish the jar without FX and either you use the launcher (targeting end users) figure it out for you, or you know how to use your environment tools to put FX on the path when you run Recaf yourself (linux and AUR maintainers)
I don't maintain the AUR release
No, let me illustrate the point again with this graphic |
I'm using the -git version which is on the latest 5.x versions |
Create Platform Shaded Jars
It would be nice if you could create a platform-dependent shaded jar, to avoid needing to download javafx for the platforms you're not on.
This will substantially decrease the size of the resulting jar.
Here's a project I made which does this:
https://github.com/PolyhedralDev/BiomeTool/
the TL;DR of what I did is, I added 3 new configurations:
linuxImplementation
windowsImplementation
osxImplementation
then, I just loop through all the javafx modules I want to add and add the specific platform version of each one:
and lastly you just need a shadow task for each one:
you can check out the buildscript for all the other stuff it does
The text was updated successfully, but these errors were encountered: