I am trying to write a custom task that should execute an annotation processor using
kapt now I know that it should be done automatically but I am facing a specific problem:
- I have a multi modules project where modules depend on each others (it’s dynamic and my plugin doesn’t know anything about the dependency)
- I have to run
kapttasks from all modules before any compilation is invoked. I have tried
dependsOnbut it seems like
kaptDebugKotlintask declares a dependency on
compileDebugKotlin(mustRunAfter kind of dependency), this means that once
kapttask from a module is done that task will be executed immediately. The problem occurs when the compilation process takes place and fails because some sources from another module (which should be generated by kapt) are not generated yet.
My problem is simple to explain so in short I need to know a way to Execute all
kapt tasks from all modules right when the build starts.
Any help please??