GradleUp / shadow

Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin.
https://www.gradleup.com/shadow/
Apache License 2.0
3.71k stars 392 forks source link

Relocation Duplicates Simple Package Names #295

Open maezred opened 7 years ago

maezred commented 7 years ago

Please check the (User Guide)[http://imperceptiblethoughts.com/shadow] before submitting "how do I do 'x'?" questions! I'm still a little new to Gradle, so I'm not sure if this is an issue or just me misusing everything. Thanks!

Shadow Version

1.2.4

Gradle Version

3.5

Expected Behavior

kotlin.kotlin_builtins is moved to cafe.neso.bouncer.minecraft.lib.kotlin.kotlin_builtins I'm not sure if this is what I want or what would fix this issue. I'm getting this exception specifically: java.lang.IllegalStateException: Resource not found in classpath: cafe/neso/minecraft/bouncer/lib/kotlin/cafe.neso.minecraft.bouncer.lib.kotlin.cafe.neso.minecraft.bouncer.lib.kotlin_builtins

Actual Behavior

kotlin.kotlin_builtins is moved from kotlin to cafe/neso/bouncer/minecraft/lib/kotlin but the package remains as kotlin in the file, while other files appear to be referencing cafe.neso.bouncer.minecraft.lib.kotlin.cafe.neso.bouncer.minecraft.lib.kotlin.kotlin_builtins (note the duplication)

Gradle Build Script(s)

https://gist.github.com/moltendorf/2735da9fa626b4fc2aab49a0eb3eca6e

Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)

https://gist.github.com/moltendorf/2735da9fa626b4fc2aab49a0eb3eca6e#file-jar-files

johnrengelman commented 7 years ago

I honestly wouldn't know where to start with Kotlin projects.

maezred commented 7 years ago

I'm still testing this with Shadow 2.0.0 as I haven't had a chance to go back and try a build of the project in that state (unsure if it's relevant with the auto relocation).

alesimula commented 5 years ago

@johnrengelman this bug is still present, it only happens when relocating the kotlin package and only with the kotlin.kotlin_builtins class (maybe because it does not have a .class extension?)