utopia-rise / godot-kotlin-jvm

Godot Kotlin JVM Module
MIT License
585 stars 38 forks source link

Relocate conflicting class files in fat jars #444

Open chippmann opened 1 year ago

chippmann commented 1 year ago

Especially with https://github.com/utopia-rise/godot-kotlin-jvm/pull/441 there could be cases now where classes have the same fqName from different dependencies. If that's the case, they'll override each other, and only one of them will be present in the final main.jar fat jar. Which leads to nasty bugs.

Shadow jar has a feature where classes can be relocated to a different package path if they are conflicting, and automatically update the usages: https://imperceptiblethoughts.com/shadow/configuration/relocation/#automatically-relocating-dependencies

We should take advantage of this to prevent this issue

travisfw commented 11 months ago

Wasn't this the whole purpose of project Jigsaw? I thought the java module system was specifically designed to solve these problems for everyone. I certainly could be wrong…