@Lance I understood that the hard way, and how gradle works after I saw your comment in the other thread. Let me put some context here:
I am developing a gradle plugin that will handle navigation in multi module project. I have put all the basic blocs there and everything works like charm. As I am finalising the plugin I wanted to automate everything for the users so they don’t have to configure anything (plug and enjoy).
My plugin works this way:
- in a project (user project) there is a sub-project named
service
this will handle the routing part of the navigation. - there could be
n
other sub-projects that depend onservice
. They Have also classes annotated with some annotation which describes thespecs
of the navigation (destination, args…) - since i am configuring
kapt
compiler into these sub projects they will run the taskkaptDebugCompile
and generate some source files. The annotation processor will output the files into theservice
subproject build directory. - All sub projects that depend on
service
will then reference these generated classes from within `service.
Now when i compile the demo
of the plugin, the compilation fails cuz service
was compiled before kapt
tasksfinished executing. Therefore the compiled
service` has no class definition of these generated classes.
I need a way to make :service:compileDebugKotlin
depend on :someProject:kaptDebugKotlin
. It’s sad that I can’t do that because :someProject:kaptDebugKotlin
it self depends (by default) on :service:compileDebugKotlin
becase someProject
compiles service
.
I know no way how to create kaptDebugKotlin
with different config/params.
can you suggest something or point me to the right direction in case i am wrong with something?
Thanks a lot