Support the Java Module System
See original GitHub issueI’m quoting directly from https://github.com/Kotlin/kotlinx.serialization/issues/940 because the same reasoning applies:
What is your use-case and why do you need this feature? As of Kotlin 1.4-M3, Java 9 module descriptors have been added to the standard library artifacts (KT-21266). It would be nice to see this also happen to libraries in the Kotlin ecosystem going forward as this would enable Kotlin JVM applications to benefit from modern JDK tools (such as jlink).
Describe the solution you’d like Ideally, an explicit descriptor would be added using the Multi-Release JAR mechanism (JEP 238) added in JDK 9 (just as it was done for the standard library).
Additionally,
- I’m currently working on a desktop application for which using the module system (with
jlink
andjpackage
) is extremely handy and I would love to usekotlinx.coroutines
without additional non-trivial build-system hacks. - Publishing a library with an explicit module descriptor and with a dependency on
kotlinx.coroutines
is not possible because the latter does not have a stable module name.
A temporary (and fairly simple) solution for 2.
would be providing stable Automatic-Module-Name
entries.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:20
- Comments:24
Top GitHub Comments
I opened PR https://github.com/Kotlin/kotlinx.coroutines/pull/3297 with full support for JPMS. However, there is still an open issue with highlighting in IntelliJ IDEA that is kind of annoying…
~~I created a PR which adds a dedicated
module-info
: https://github.com/Kotlin/kotlinx-datetime/pull/135~~ Whoops, wrong repo / issue… Anyway, I’m working on a PR to add JPMS support to kotlinx.coroutines. The biggest challenge is probably to add JPMS support to upstream libraries / dependencies first. My progress can be found here: https://github.com/lion7/kotlinx.coroutines/