Support Kotlin relocations #1680
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes custom Kotlin metadata relocation support code and refactors the main Shadow plugin to handle Kotlin relocations directly. The changes integrate Kotlin class and module processing into the core ShadowCopyAction instead of maintaining separate plugin infrastructure.
- Removes dedicated KSR (Kotlin Shadow Relocator) plugin files and relocator classes
- Integrates Kotlin metadata processing directly into ShadowCopyAction
- Adds RelocationClassWriter to handle Kotlin-specific symbol table relocations
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| RelocatingClassWriter.kt | Removed - was handling Kotlin class symbol table relocations |
| MetadataAnnotationScanner.kt | Removed - was scanning and relocating Kotlin metadata annotations |
| KotlinShadowRelocatorPlugin.kt | Removed - was the main plugin entry point for Kotlin relocations |
| KotlinRelocation.kt | Removed - contained core relocation logic and extension functions |
| ShadowCopyAction.kt | Modified to include Kotlin module processing and use new RelocationClassWriter |
| RelocationClassWriter.kt | Added - new implementation for handling Kotlin class relocations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| init { | ||
| // If the class is a Kotlin class, we need to apply relocations to the symbol table. | ||
| if (classReader.isKotlinClass()) { |
There was a problem hiding this comment.
The isKotlinClass() method creates a ClassVisitor and processes the entire class file to check for a single annotation. This could be expensive for large classes. Consider using ClassReader.readUnsignedShort() and parsing annotations more efficiently, or caching this result to avoid repeated scanning.
642c30e to
a76338d
Compare
8d3ffe7 to
8c9c78a
Compare
a76338d to
9426a2c
Compare
Refs #1539.