Hi folks! Ever wanted `compileOnly` dependencies ...
# feed
b
Hi folks! Ever wanted
compileOnly
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.
👍 2
K 1
c
Congrats on being featured in Kotlin Weekly! I like the idea, but... there's no way this can work with isolated projects, right?
b
What? U sure this is the right thread? What kotlin weekly? On a more serious note. It could work if you own one single
carrier
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 hell
👍 1
c
b
Thanks! I was not aware of this newsletter.
For context: https://github.com/a-sit-plus/modulator/issues/2. It's really more of a "how do we want to model this in the gradle DSL" issue than anything else. Could be implemented in 2 hours. As for publishing metadata-only dependencies: I am not sure there is even a need for this. When do you want do publish a bridge dependency without owning anything it depends on? Serious question here