Will Amper provide native support for using Kotlin...
# amper
s
Will Amper provide native support for using Kotlin sources within Java modules (JPMS)? Currently in Gradle, this requires complex configuration ( https://github.com/JakeWharton/mosaic/blob/6c449af41608f78c083222b25c309e5f1638cc78/build-support/src/main/kotlin/com/jakewharton/mosaic/buildsupport/MosaicBuildExtensionImpl.kt#L15) to properly patch modules, which is cumbersome to set up.
a
Hi what do you need JPMS support for?
s
@Anton Prokhorov you mean the purpose of jpms ? First of all, it’s part of the core Java platform, and modularizing a library (module jar) provides better configuration and encapsulation on modern JVMs. My use case is with jlink, as it will allow creating a jlinked runtime with no configuration for modular jars.
a
No, I actually meant what you personally are going to do with modularization of your libs? As far as I understand, using jlinked runtimes doesn't imply having your jar modularized in order to run it inside this runtime
s
Yeah, but you need to provide the whole module path (created using jdeps, an additional step) for non-module jars/applications, which can be incorrect sometimes depending on reflection usage. For module jars, you will get that integrity, and without any additional configs you can create a jlinked runtime. I wanted to do this in Amper: honor module-info.java if it’s present and create a modular jar with any additional configs (like --patch-module). The resulting jar/app can be used like
Copy code
jlink --module-path . --add-modules myapp --output app
a
and what are you building if it's not a secret?
or what you need jlinked runtime for? if it's easier to answer
s
I’m exploring Amper to validate a use case I have with Gradle. Using Kotlin + Java + module-info.java is a pain point in KGP, and I’d like to see this addressed in Amper. We use jlinked runtime to create containerized applications, which significantly reduces image size, or for apps that need to distribute the JDK.
👍🏻 1
🙏 1
a
That's valid, definitely should be on the table Please vote here
thank you color 1