Hi folks :wave: For an android project, I am tryi...
# ksp
s
Hi folks 👋 For an android project, I am trying to read an annotation in the main source set and then generate some test code in the androidTest source set. Here's what I have so far: 1. If I apply
ksp(:processor)
, the code is generated in
/build/generated/ksp/debug/
but then the generated code is not able to resolve the androidTest dependencies. 2. If I apply
kspAndroidTest(:processor)
, my processor is not able to find the annotations in the main source set. Any tips ?
m
You could run your processor in the
main
source set and have it generate your code as resources that you then
srcDir
in the
test
source set.
s
Hi Martin! Are these resources a special location recognized by ksp or do you mean I generate my own directory "resources" that I can add as source to the test. I couldn't quite find anything about the former
Android might be slightly different
But this is the general idea.
Then you would also need to remove the resources from you
main
jar if you don't want them...
So there are a few moving parts. There might be easier solutions. But this should work!