-
-
Notifications
You must be signed in to change notification settings - Fork 424
Support disabling Kotlin module metadata remapping #1875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5834c7c to
14155b7
Compare
|
CC @Tapchicoma |
14155b7 to
8f52e35
Compare
8f52e35 to
55c528a
Compare
| path.endsWith(".kotlin_module") -> { | ||
| if (relocators.isEmpty()) { | ||
| if (relocators.isEmpty() || !enableKotlinModuleRelocation) { | ||
| fileDetails.writeToZip(path) | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to expose the transform step for .kotlin_module files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I see - the current change just disables remapping, but still does not trigger generic transformer. It would be nice to add a support for custom .kotlin_module transformer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a new issue: if the relocators is not empty, remapKotlinModule will be called first. Should we pass the relocated module file to transformers? I believe what you want here is passing the original module file to your custom transformer, and doing nothing from Shadow side. Just like
shadow/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt
Lines 183 to 187 in bd7f137
| else -> { | |
| val relocated = relocators.relocatePath(path) | |
| if (transform(fileDetails, relocated)) return | |
| fileDetails.writeToZip(relocated) | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling the newly added flag should align the behaviors with 8.x versions. Are you fine with the new flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, should be fine
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt
Outdated
Show resolved
Hide resolved
a9488aa to
a294bd5
Compare
Closes #1874.