This message contains interactive elements.
# ksp
d
This message contains interactive elements.
y
you can even use dagger ksp in modules with other kapt processors as long as the generated types don’t interact with dagger, you just won’t get all the benefits until you completely remove kapt from that module
d
so it is safe ? because they are saying KSP processors are not able to resolve types generated by other Javac/KAPT processors i mean what happen if module 1 with ksp dagger interact with module 5 with kapt dagger?
y
The interactions are only relevant in the same module
j
for cross module interaction, it should be resolved at user level by specifying the ordering of building modules.
y
@Jiaxiang can you please elaborate when cross module interactions would become a problem?
j
say if you have module A and module B and some of A’s class relies on a to-be-generated symbols b in B, and some of B’s class relies on a to-be-generated symbol a in A, if they are in same module then this is not an issue as multiple round will eventually tries to converge after tries, but in a cross module case it is not possible because once we have done processing one module we can’t go back to process that module again.
y
But isn’t that a circular dependency?
j
it doesn’t really matter whether it is a circular dependency or not, circular dependency is up to build system to figure out. The main point here is that a module in a build is only processed once so if users have cross module interactions, the user needs to be very certain about the restriction here, and to me this can easily get things hard to sustain. In the example above, it is technically feasible if we know for sure that processing A generates a0 which unblocks processing B, but not enough to unblock A itself, then processing B generates b which unblocks A, and if we look back, we can now compile A, if you can manage to run specific KSP tasks in order, you can eventually run the compilation task, ultimately you can run everything from command line (in the order of : kspA, kspB, kspA, compileA, compileB) if you are really concerned about circular dependency.
👍 1