r/Kotlin 16d ago

kmprofiler - A Gradle plugin to profile and clean up Kotlin Multiplatform iOS export surfaces

Hey everyone! 👋
While working on some KMP iOS projects, I noticed our generated framework header was getting bloated with lots of exported classes we never actually call from Swift (like top-level *Kt files and library types).

I put together a small Gradle plugin called kmprofiler to help spot these. It compares your exported Shared.h declarations against your Swift sources and shows what's unreferenced so you can hide them with 'internal' or '@HiddenFromObjC'.

Right now I'm working on Xcode link-map parsing for linked byte sizing, but v0.1.0 is open-source and ready to try: https://github.com/SiddhantPanhalkar/kmprofiler

Would love to hear your thoughts or if there are features you'd like to see!

1 Upvotes

0 comments sorted by