Bernd Prünster
08/27/2025, 9:12 AMcompileOnly dependencies for Kotlin Multiplatform?
Ever puzzled about why the killer combination of extension functions and compileOnly dependencies isn't doable for KMP projects?
Ever wary of unpredictable RuntimeExceptions when actually using compileOnly dependencies on the JVM?
Enter modulator – a lean Gradle plugin that brings two complementary capabilities to Kotlin Multiplatform:
1. Piggyback modules with extension functionality and/or glue code on two or more other modules within a multi-module project.
2. Automatically add those piggybacked modules as dependencies when all of their dependencies are present in a consuming project.
Just apply at.asitplus.gradle.modulator to any Gradle module that requires either capability. That’s it – no custom wiring, no dependency clutter, no hacks, no compiler plugins, no code generation, but full backwards compatibility with all Kotlin and Gradle tooling!
Checkout the Link for more details and showcase projects!
The current 0.1.0 release is ready to use, but still in an exploratory state to gather external feedback and to get an idea about the actual demand for the features it brings.
Try it out, tell us about your use cases (I'm thinking proper KMP logging facade for, for starters), and let us know what you think about it! We will be developing it further, because we do have a concrete need for it, but any external input is very much welcome to make it useful for a wieder user base.CLOVIS
08/31/2025, 12:16 PMBernd Prünster
08/31/2025, 12:50 PMcarrier dependency and the glue/bridge dependency. If you don't own any carriers it can be made to work by publishing metadata-only artefacts for those carriers. But that requires some serious thinking and a design process to not descend into a whole new flavour of incomprehensible dependency hellCLOVIS
08/31/2025, 12:51 PMBernd Prünster
08/31/2025, 12:51 PMBernd Prünster
08/31/2025, 12:55 PM