Skip to content

Conversation

@Goooler
Copy link
Member

@Goooler Goooler commented Nov 25, 2025

Closes #1874.


  • CHANGELOG's "Unreleased" section has been updated, if applicable.

This comment was marked as outdated.

@Goooler Goooler force-pushed the g/20251125/disable-relocate-kotlin-module branch from 5834c7c to 14155b7 Compare November 25, 2025 01:43
@Goooler
Copy link
Member Author

Goooler commented Nov 25, 2025

CC @Tapchicoma

@Goooler Goooler force-pushed the g/20251125/disable-relocate-kotlin-module branch from 14155b7 to 8f52e35 Compare November 25, 2025 01:55
@Goooler Goooler force-pushed the g/20251125/disable-relocate-kotlin-module branch from 8f52e35 to 55c528a Compare November 25, 2025 02:05
Comment on lines 176 to 179
path.endsWith(".kotlin_module") -> {
if (relocators.isEmpty()) {
if (relocators.isEmpty() || !enableKotlinModuleRelocation) {
fileDetails.writeToZip(path)
} else {
Copy link
Member Author

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.

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.

Copy link
Member Author

@Goooler Goooler Nov 25, 2025

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

else -> {
val relocated = relocators.relocatePath(path)
if (transform(fileDetails, relocated)) return
fileDetails.writeToZip(relocated)
}

Copy link
Member Author

@Goooler Goooler Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

276692a

Disabling the newly added flag should align the behaviors with 8.x versions. Are you fine with the new flag?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, should be fine

@Goooler Goooler closed this Nov 25, 2025
@Goooler Goooler deleted the g/20251125/disable-relocate-kotlin-module branch November 25, 2025 02:22
@Goooler Goooler restored the g/20251125/disable-relocate-kotlin-module branch November 25, 2025 09:05
@Goooler Goooler reopened this Nov 25, 2025
@Goooler Goooler requested a review from Copilot November 25, 2025 09:27
@Goooler Goooler changed the title Support disabling relocation of Kotlin module metadata Support disabling remapping of Kotlin module metadata Nov 25, 2025

This comment was marked as outdated.

@Goooler Goooler changed the title Support disabling remapping of Kotlin module metadata Support disabling Kotlin module metadata remapping Nov 25, 2025
@Goooler Goooler force-pushed the g/20251125/disable-relocate-kotlin-module branch from a9488aa to a294bd5 Compare November 25, 2025 09:34
@Goooler Goooler merged commit 2aec97d into main Nov 26, 2025
8 checks passed
@Goooler Goooler deleted the g/20251125/disable-relocate-kotlin-module branch November 26, 2025 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support custom .kotlin_module transformers

3 participants