KMP – Gradle plugin that generates a Swift representation of a Kotlin iOS Module

Hey folks, I want to share a cool project I have being working on to improve the iOS Team visibility and inputs on Mobile Multiplatform projects by generating Swift representations of Kotlin Modules.

You run a gradle task `swiftReveal` in a module with iOS Target, and then it will generate the swift that the iOS Developers can have inputs on it to improve naming of functions, properties and also see up front when something will not work properly in iOS, for example Generic types.

Is literally a tool of increasing visibility, OBJC header is hard to read because Kotlin uses a bunch of annotations to improve Swift interop, also, it is huge. Another thing is that, if you are using a Multi module setup, you will have an “umbrella” module that generates the Framework/XCFramework for iOS and not for each module, so, usually requires building everything in this umbrella module and fight for finding declarations for your modules, so this tool also helps when you have Feature/Product Teams working on specific feature and want to understand what their feature reference will look like.

You can also hook this tool into the CI, for example, publishing the Swift generate file in the Github PR comment (if you are using github as your project repository), is really flexible, there are couple examples of Github Actions on the Repository as well.

https://github.com/DevSrSouza/kmp-swift-reveal/

submitted by /u/DevSrSouza
[link] [comments]