Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [jdt-apt-dev] AnnotationProcessors, Jar files, and quick fixes

Hi, J.P.  Nice to hear such excitement!

Let me encourage you to use the eclipse.tools.jdt newsgroup, rather than
the mailing list, for questions on APT.  More people pay attention to
it, so you'll be more likely to get good answers, and it'll be easier
for others to search for those answers later.  And of course, you are
welcome to use Bugzilla (bugs.eclipse.org) to enter enhancement requests
and bug reports.

Re specifying a directory of compiled classes, the easiest way to get
this to work is to package your processors as plug-ins.  This is
discussed some in the Eclipsecon 2007 tutorial that's linked from the
APT web page, at http://www.eclipse.org/jdt/apt/index.html .  If you do
it this way, then the Eclipse plug-in development environment (PDE) does
the dirty work for you.

But basically, processor development is like plug-in development, in the
sense that you are writing code that is running as part of Eclipse (in
this case, as part of the compiler).  So you will always end up having
two instances of Eclipse, one being the "host instance" containing the
processor project, the other being the "target instance" that is running
the processor (and that contains the annotated code you are trying to
process).  It doesn't work to be editing the processor in the same
Eclipse instance that is running it, because in effect you'd be trying
to edit the compiler that you're compiling with.  That becomes a
classloader nightmare that we have avoided trying to solve.

Regarding the second question, the quick fix classes should be packaged
in the same place as your processor; one more reason to package the
processor as a plug-in rather than just as a jar.  Note that these are
not exclusive - you can have a processor that is an Eclipse plug-in but
that is still able to be used by javac at the command line, for instance
in Ant builds.  The tutorial discusses how to do this.

I'll be glad to try to go into more detail if needed - again, let me
encourage you towards the newsgroups rather than the mailing lists.

Thanks,
 -Walter Harley
  JDT APT lead
 

> -----Original Message-----
> From: jdt-apt-dev-bounces@xxxxxxxxxxx 
> [mailto:jdt-apt-dev-bounces@xxxxxxxxxxx] On Behalf Of J.P. Pellet
> Sent: Thursday, October 23, 2008 9:47 AM
> To: jdt-apt-dev@xxxxxxxxxxx
> Subject: [jdt-apt-dev] AnnotationProcessors, Jar files, and 
> quick fixes
> 
> Hi everyone,
> 
> I have discovered APT in the last few days and first of all, 
> I have to say how incredibly handy and elegant this is. The 
> JDT-APT implementation is also pretty impressive, great job, really!
> 
> I have two concerns. First of all, I'd find it nice to be 
> able to specify also a directory of compiled classes in 
> addition to jar files and plugins as a place to put 
> AnnotationProcessors. For now, each time I change my 
> processor source code, I have to regenerate the jar file 
> referenced from the project properties page as source for 
> AnnotationProcessors. If I could just specify the "bin/" 
> folder of the project containing my processor, I wouldn't 
> have to do this - or am I missing something?
> 
> Second question (I guess common, put couldn't get it to work) 
> is about providing a quick fix for my errors. Do I need to 
> package whatever classes are needed to do this in a plugin 
> that belongs in my plugins folder, or can these classes be 
> looked up in some referenced location, similarly to what is 
> done for AnnotationProcessors?
> 
> Thanks in advance for your answers. Love this API, really, I 
> haven't been so excited about a language features and what it 
> allows in years.
> 
> Cheers,
> J.-P._______________________________________________
> jdt-apt-dev mailing list
> jdt-apt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jdt-apt-dev
> 



Back to the top