Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [jdt-apt-dev] Debugging Annotation Processors in Eclipse

Manish, this is working fine for me.  Here's what I did:
 
1. Unzipped your zip file into a workspace d:\temp\manish.  Started Eclipse (with APT plugin installed), loaded that workspace, and imported and built the project.
 
By the way, I notice that you have apt enabled in that project.  I don't know why, since you don't have any annotations to be processed in that project.
 
2. Put a breakpoint on DemoAnnotationProcessor.process().  Launched the project in the debugger, using "Debug As -> Eclipse Application", with the default workspace (d:\temp\runtime-EclipseApplication).
 
3. In the second Eclipse instance (the instance being debugged, that is, the one whose workspace is d:\temp\runtime-EclipseApplication), created a new Java project named Foo.  Enabled apt for Foo, and added annotations.jar to the Java build path for Foo.
 
4. In project Foo, created a new Java class named Bar.  In Bar, added a method named bar() and annotated it with @DemoAnnotation.
 
Immediately, the breakpoint on DemoAnnotationProcessor.process() is hit, in the first Eclipse instance (d:\temp\manish).
 
 
If this is not working for you, can you send us a copy of the project containing the annotated code you're trying to process?  Are you sure that you have apt enabled on that project?
 
Thanks,
  -Walter Harley
   APT dev team


From: jdt-apt-dev-bounces@xxxxxxxxxxx [mailto:jdt-apt-dev-bounces@xxxxxxxxxxx] On Behalf Of Manish Bhargava
Sent: Monday, December 19, 2005 9:39 AM
To: jdt-apt-dev@xxxxxxxxxxx
Subject: [jdt-apt-dev] Debugging Annotation Processors in Eclipse


Hi guys,

I have been trying to debug annotation processor but no luck yet.

On  the web site it says...
"
To debug an annotation processor it must be run from a plugin. You develop your code in the plugin, and then debug it by annotating source code in a spawned instance of Eclipse. The debugging instance needs the annotation declaration, the factory, and the processor. The spawned instance only needs access to the delaration.

"

I created a plugin based on the APTDemo. The processor code  is in the plugin source folder along with a jar dependency where annotations (@TypeGeneratingAnnotation and @DemoAnnotation) are defined. Annotating the src code within a java project (which has the annotations.jar in classpath) )in a spawned instance of Eclipse does not invoke the processor (the break points do not get called).

I am not sure what an I missing here but any help is appreciated. The plugin zip file in my workspace is attached along with a pic below.





-Manish

Back to the top