|Running annotations after other classes generated [message #652697]
||Sat, 05 February 2011 15:58
| Alan Chaney
Registered: January 2010
I've written a Java 6 annotation processor. It reads some of my annotations and generates new source files for classes by reading, and introspecting, existing classes. I believe that this is a typical annotation processing task.
The problem I have is that if I do a clean before a compile, some of the dependent classes don't exist, which is of course not surprising (as the annotation is being read during the source pass.) Is there any way that I can ask that the annotation processor is run *after* the other classes have been compiled? In effect, make the process multi-pass? I've fudged it at the moment by using an ant script which 'touches' the files I want to process, but that doesn't seem very elegant.
The only other way that I can see to do it is to add some kind of marker annotation to the output source, and then ask my annotation processor to build it all again.
Sorry if this has been answered before, but I can't find much on annotation processing on the site.
Thanks in advance
Powered by FUDForum
. Page generated in 0.06741 seconds