I’m near the end of creating a KMP gradle conventi...
# kotlin-dsl
b
I’m near the end of creating a KMP gradle convention plugin and ran into some issues that I think may be because I’m configuring things too late (generated sources aren’t being picked up). Android Gradle Plugin has a hook that makes it easy to configure at the right time. Is there something similar to the AGP version but for KMP? Android has the
finalizeDsl
hook.
Copy code
plugins.withId("com.android.application") {
   val androidComponents = extensions.getByType(ApplicationAndroidComponentsExtension::class.java)
   androidComponents.finalizeDsl {
     it.configureAndroid(extension)
   }
 }
v
This channel is for Kotlin DSL usage, not for how to do something with KMP plugin. For that #CAHSN3LDN or maybe even better the #multiplatform or #gradle channels in the Kotlin Slack are more appropriate. Besides that the AGP functionality is most probably also not "the right time" but most probably suffers from the exact same problems
afterEvaluate
suffers. But well, I'm not into Android development, so I might be wrong.
b
Ah okay, I did post over there. I wasn't quite sure where to post it since most multiplatform questions are kotlin related and not kotlin gradle related
v
Well, over there at #gradle it might be better as I said 🙂
b
Done. Thanks for the suggestion. Also funny enough as I've been working on my gradle convention plugin I've come across your posts on the gradle forums probably 50 times. You're the gradle legend 🙂
👌 1