Stylianos Gakis
11/25/2025, 1:23 PMorg.jetbrains.compose.resources.ResourcesExtension from my gradle convention plugin, but I can't seem to find the way to do this at the right time.
When doing:
project.pluginManager.apply("org.jetbrains.compose")
project.pluginManager.withPlugin("org.jetbrains.compose") {
// 1
project.configure<org.jetbrains.compose.resources.ResourcesExtension> {
// 2
}
}
I can see that I can get in //1 but not in //2.
I see that the resources extension is created after the ComposePlugin is applied https://github.com/JetBrains/compose-multiplatform/blob/1b40a6db80c9f97859ac56c088[…]/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt so I figured it should be available.
When using the generated DSL and doing this outside of my convention plugin (compose.resources { ... }) this works fine, so I am sure there is something I am doing wrong regarding the ordering of things. Or it's something else I don't understand.Stylianos Gakis
11/25/2025, 1:35 PMval composeExtension = project.extensions.create("compose", ComposeExtension::class.java, project)
val resourcesExtension = composeExtension.extensions.create("resources", ResourcesExtension::class.java)
Ah just realized it's added on top of the ComposeExtension as it itself is also ExtensionAware.
So doing this instead works
project.configure<ComposeExtension> {
extensions.configure<ResourcesExtension> {
...