Kotlin + JavaFX + Gradle + Jigsaw

Bit of a rant and a question – I recently revived an old project of mine that was written with JavaFX. Loved the framework at the time and I know that it hasn’t really gotten a lot of traction and probably half of the people reading this are itching to recommend me to go with a different framework, but that’s besides the point. JavaFX worked great so far.

But I just spent multiple hours trying to get my rather simple project to run utilize the module-system introduced in Java 9 and it’s a mess. All error-messages are cryptic and useless. Gradle plugins are a mess. There’s very little information about running a Kotlin project with Jigsaw and every solution I find is from questionable sources like a stackoverflow post with like 5 upvotes.

In my current iteration of struggling with this, I’m trying to use the org.javamodularity.moduleplugin gradle plugin, but I can’t seem to get my test sourceset to find any of my classes from the main sourceset at runtime.

So if anyone has some pointers for me – I’d be very grateful.

EDIT: BTW Gradle docs claim that what I’m trying to do should work out of the box: https://docs.gradle.org/current/userguide/java_testing.html#whitebox_unit_test_execution_on_the_classpath

I suspect there might be some weird kotlin-java-interop problem at foot.

EDIT2: And oh boy, is it hard to find any meaningful information about this topic, even just for the fact that there are so many co-existing concepts in this space that are all called modules.

submitted by /u/gemengelage
[link] [comments]