[Solved] Extension functions not available when exported to JAR


#1

Hello Kotlin community, I have a problem with exporting my projects API into a JAR in that all extension functions are not resolved when using said JAR in another project. I am including all the compiled .class files inside the API JAR, I’ve taken a look inside the artifact to confirm that the corresponding .class file is in there but still no idea why I can’t use it when I include the JAR as a dependency.

This is the project in question: https://github.com/waicool20/SKrypton

Help is appreciated thanks

Edit:

For example in the Quick Start code snippet in the README utilizes an extension function screen on SKryptonApp
The fresh project can resolve SKryptonApp but not screen, it is defined here: https://github.com/waicool20/SKrypton/blob/master/src/main/kotlin/com/waicool20/skrypton/sikulix/SKryptonScreen.kt


#2

It looks like the metadata from *.kotlin_module file is lost during shadowing. Could you check it is in the resulting jar? If not, you may need to tweak some settings of shadowJar


#3

I included the *.kotlin_module files in the jar and it works now, thanks!