Skip to content
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

Fixes Dagger's shading to properly handle kotlin metadata #2777

Merged
merged 1 commit into from
Jul 27, 2021

Conversation

copybara-service[bot]
Copy link

Fixes Dagger's shading to properly handle kotlin metadata

The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched from jarjar to using Gradle's shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Also, I've added a kotlin regression test in gradle.

Closes #2765

RELNOTES=Fix #2765: Fixes Dagger's shading to properly handle kotlin metadata.

@google-cla google-cla bot added the cla: yes label Jul 23, 2021
@copybara-service copybara-service bot force-pushed the test_386485460 branch 5 times, most recently from fd71735 to 40e26da Compare July 27, 2021 15:45
The issue was due to incorrect handling of shading in jarjar for kotlin metadata. In particular, jarjar does not replace UTF8 usages in the classfile, so the Strings in the kotlin metadata do not get replaced. This breaks when the class is compiled with kotlinc which uses the kotlin metadata during compilation.

To fix this, I've switched from jarjar to using Gradle's shadowJar to do the shading (https://imperceptiblethoughts.com/shadow/).

Also, I've added a kotlin regression test in gradle.

Closes #2765

RELNOTES=Fix #2765: Fixes Dagger's shading to properly handle kotlin metadata.
PiperOrigin-RevId: 387123329
@copybara-service copybara-service bot merged commit ef7e7a1 into master Jul 27, 2021
@copybara-service copybara-service bot deleted the test_386485460 branch July 27, 2021 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XBasicAnnotationProcessor not fully shaded and confuses kotlinc in 2.38
1 participant