I've been watching several issues that have been c...
# server
i
I've been watching several issues that have been collectively blocking me from migrating Kotlin projects to the Java Platform Module System. It's a major feature of the Java platform since version 9+ (version 17 is the current LTS), and notably is now required by JavaFX, so I'm a bit surprised there's not more votes and priority on these. Are others not using JPMS, or are you not running into these issues, or do you have workarounds for them? Here's the list (severity and status notes mine): • Kotlin Gradle Plugin ◦ https://youtrack.jetbrains.com/issue/KT-20740 ▪︎ Severity: Blocker. No way to specify JPMS overrides for modules implemented in Kotlin. ▪︎ Status: Unresolved. No known workaround. 5 years old. ◦ https://youtrack.jetbrains.com/issue/KT-55389 ▪︎ Severity: Blocker. Special Gradle configuration required. Intermittent build failures. ▪︎ Status: Unresolved. Workaround doesn't seem to work.https://youtrack.jetbrains.com/issue/KT-55200 ▪︎ Severity: Minor. Lack of sufficient documentation. ▪︎ Status: Unresolved. • IntelliJ ◦ https://youtrack.jetbrains.com/issue/IDEA-220886 ▪︎ Severity: Critical. Good code red in IDE. ▪︎ Status: Unresolved. No known workaround. 4 years old. ◦ https://youtrack.jetbrains.com/issue/IDEA-304601 ▪︎ Severity: Critical. Good code red in IDE. ▪︎ Status: Unresolved. No known workaround.
In addition to internal projects, a side project this is holding me up on is an an attempt to replace the JavaFX Gradle Plugin with native Gradle configuration: https://github.com/ianbrandt/javafx-gradle-configuration.
c
After several attempts at jpms ultimately decided not to use it due to limited value, too many challenges. Multi-module projects with well designed boundaries provides reasonable separation.
👍 1
i
Makes sense. Unfortunately the JavaFX requirement is forcing my hand.
c
Not that familiar with javafx - does it require jpms?
i
Granted that's a UI concern, but I posted in #server since the issues apply to the JVM platform in general.
c
Yea. Odd design choice to force jpms, especially for ui stuff.
i
I work on a very large and long-lived "modulithic" application that admittedly could benefit from JPMS in general. We try to keep it well organized and maintain clean module boundaries, but without tooling support they get unintentionally blurred more often than we'd like. Autocomplete is the primary culprit. The additional encapsulation facilities of JPMS could help with that.
Making elements
internal
of course helps, but then we run into KTIJ-23114 trying to integration test.
m
Makes sense. Unfortunately the JavaFX requirement is forcing my hand.
Wild that you're running into this issue just as someone opened a ticket for it on my library for their JavaFX app. He's got a custom plugin that will repackage and produce files for libraries he uses which do not provide
module-info.java
files. See link in THIS ISSUE which has his custom plugin and how he's using it. On a side note, do you or anyone here know of a gradle plugin that will automagically generate
moudle-info.java
files for Kotlin Multiplatform projects such that they are included along with the
-jvm
dependencies? Doing this manually doesn't seem to be supported in Intellij IDEA for KMP projects, unless I'm doing something completely wrong (totally possible) 😢 .
Wish there was a way to enable this via the
KotlinMultiplatformExtension
, sort of like how you can express
explicitApe()
. Something like
supportJava9Modules()
which would be enabled if you have a
jvm
source set would be slick...
👍 1
i
IDEA-220886 was resolved as a duplicate of IDEA-304601, and the latter seems to now be potentially targeted for a 2022.3.x release, so progress! Fingers crossed for some movement on the KT issues as well.
🙌 1