Hi Folks, Can we enable annotation processing on a...
# ksp
r
Hi Folks, Can we enable annotation processing on a project's dependencies? Right now when I use the Resolver in a Symbol Processor for a library, only the annotated files of this library are picked up. Is there a way to enable the resolver to pick files from dependent libraries?
m
Resolver.getDeclarationsFromPackage()
will get them
y
Note that, the common way of solving these is to actually make the compiled code somehow depend on those library classes explicitly. E.g
Copy code
@Include(SomeClassFromDependency::class)
SomeClassFromCurrentCompilation
Then your processor handles that include annotation as well.
But ideally, even with this, you want whatever code needs to be generated for that dependency to be generated with its compilation. Otherwise, you might get into a mess of duplicate classes due to separate compilations
r
Thank you soo much both, it worked. Appreciate it!