What's the best way to hook into Compose Resources...
# compose
c
What's the best way to hook into Compose Resources generation (in Gradle)? I want to run another Gradle task before any of the CMP Resources generation happens. The best I've come up with is:
Copy code
val sourceTask = ...

tasks.named { it.startsWith("convertXmlValueResources") }.configureEach {
    dependsOn(sourceTask)
}

tasks.named("generateComposeResClass") {
    dependsOn(sourceTask)
}
Neither of these task types are linked or dependent on each other AFAICT, so need to make them all depend on my task. Is it worth adding a single parent task?
assmebleComposeResources
or something?
1
k
I plan to implement a feature to support custom dir/tasks as input for the compose resources generation logic: https://github.com/JetBrains/compose-multiplatform/issues/4718 I think it is what you want
c
Kinda. I want to run another resources generator (in this case Twine) before CMP does anything to do with resources. That way, I can invoke twine, and move the generated output to somewhere CMP knows about.
Custom paths would be handy though. At the moment I just generate the files as
generated.xml
and gitignore that path
k
well, you will need to set your task output as input for my task, right?
c
yeah, that should work
k
You could try it in the latest dev build