I am using KSP to generate certain code. I want da...
# dagger
j
I am using KSP to generate certain code. I want dagger(kapt) to provide that code but dagger fails with
unable to resolve
even though the files get successfully generated. I am assuming it because of some order issue. is it possible to change the order of annotation processing so that my code generated by KSP always runs first and dagger's(kapt) runs after?
a
I might suggest using anvil https://github.com/square/anvil You can write custom code generators for anvil, it can skip kapt entirely for dagger
We use it to generate custom code that then anvil knows how to add to dagger itself . Makes it pretty easy
j
Sadly my project is using dagger hilt heavily and i wont be able to replace it with anvil
g
I think it's really tricky to generate code with KSP and than make it work with as input for dagger. I think it's possible, but you need own plugin to make it work. It essentially how Anvil itself works Good luck with this, but in general it's not so straightforward, concidering that dagger doesn't have extension API
It is much easier with Anvil which has extension API, this what we use too for custom code generators, solve so much boilerplate for us
thank you color 1
❤️ 1