0

I have a few annotations I've written for a project. Unfortunately some of the annotations depend on code generated by another annotation of mine.

Ironically after all the annotations run the code complies except for the kapt3 stubs... cuz unknown types.

is there anyway to fake this? If I put some annotations in a different gradle project, or any such can I control the order? I know which ones depend on which... I know it sounds ugly...

but so it a crap of error-prone boiler plate I'll have to type if this doesn't work.

Alternatively, is there a way to delete the stubs from my annotation processor?

Or am I just SOL and kapt is severally limited? (BTW, so is the new KSP AFAICT)

Thanks

West_JR
  • 372
  • 2
  • 11

1 Answers1

0

Adding this for posterity.

I got it to work using multiple grade projects.

I'm using composite builds to get this to work. You can read about it here : Gradle Composit Builds

At the bottom you have all you annotations and annotation processor. In my case I just have one processor that handles all the annotation I defined.

I have another gradle project that uses the annotations to define the "first pass" of types that are generated. It depends on the annotation project (compileOnly) as well as a kapt dependency.

Then my final project that does just a normal depend on the "first pass" project, and a kapt dependency on the annotation project (compileOnly again).

Works for me, because I only need 2 passes. Meaning the first pass generates all the types the other passes need defined.

kinda ugly but works. if anyone knows a better way I'd love to hear it.

West_JR
  • 372
  • 2
  • 11