This discussion is archived
1 Reply Latest reply: Jun 4, 2010 3:23 PM by 843793 RSS

Using the same annotation processor for multiple projects?

843793 Newbie
Currently Being Moderated
I have a plugin structure to the project I'm on. In order to automate some of the plugin call stuff, we decided to use annotation processing to be able to build the XML that is actually used to call the methods.

Each plugin is its own project.

My problem is that I want to override another plugin, "abc". I want most of abc's plugin calls and points, but a few I want to override. The problem is that the only way I've found to do this is to just manually copy the generated XML, then change a few lines where appropriate, so some of the XML points to my project, and most points to abc's. This works, but is tedious, and pretty much completely conflicts with the annotation processing idea.

I'm thinking that I could annotate my stuff to be additionally marked as an PluginOverride, then basically either re-process the other project, pulling its plugin stuff into my XML and overriding where appropriate; or even just pull in the XML that was generated by the "parent" plugin, copy it, and write it out to my own XML. However, I can't seem to find anyway to actually access that other project.
I noticed that using ElementUtils, I can pass in the fully-qualified path to a class and have it return the TypeElement (then get its annotations), but that's not exactly flexible. Trying to use a package and then get its enclosed elements didn't work either, an empty list was returned. (Strangely getting a TypeElement, then its EnclosingElement, then the package's EnclosedElements was empty, even though the Type was clearly a member).

Anyone know of a solution, to either be able to open the generated XML from abc, then manually parse it (painful, but at least somewhat reusable); or to actually reprocess another project?

Thanks a bunch!

Edited by: wic on Jun 4, 2010 8:30 AM