[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Annotations in Eclipse (Europa)

"David Goodenough" <david.goodenough@xxxxxxxxxxxxx> wrote in message 
news:fbsdjb$jtc$1@xxxxxxxxxxxxxxxxxxxx
> I will give it a try.  But certainly javac will read processors from -cp
> which logically includes what has been compiled.  Given the rounds and 
> that
> it is quite possible to have annotations in generated code I do not see
> why it should not be capable of going from source.  The only thing that
> might be a problem would be if you started with an empty bin (i.e. output)
> directory which would not have a META-INF/services directory in it.  With
> Ant it would be easy to set up to copy that first - I will try it.

Rhetorical question: Why not put the code for javac and ant into the project 
as well?  Then you could, for instance, modify the compiler to automatically 
generate the particular opcodes you want, without having to write all that 
pesky java in your source code.  You'd need some sort of shell script to 
bootstrap the build, but after it ran the first time there shouldn't be any 
problem.

Putting your annotation processor code into the same project as your 
annotated code probably feels different to you, because you're the author of 
both of them.  But there is no conceptual difference, particularly if you 
think that anyone else will ever use your framework or your annotations. 
Essentially the same issues apply.

To name just one of those issues: at runtime, the debugger does not see your 
annotation processor; so when you are developing your processor at the same 
time that you are developing the code it processes, debugging becomes quite 
a challenge.  That challenge is much easier if you have your annotations and 
your processor source code in one work space, and can develop them against 
simple, stable test cases and then deploy them to the workspace where you 
are developing your annotated code.