Annotations Processing Regression in IDEA 10?

We are using the Service Provider interface (@ProviderFor) and have the mangosdk spi-0.2.4.jar in our classpath.  In Idea 9, the only thing we needed to do to get this annotation processor to produce the proper META-INF directory and files was to check off "Enable Annotation Processing" in the Compiler->Annotation Processors panel.  In Idea 10, I find I am required to add every module of our project to the "Processed Modules" panel in order to get the META-INF to be generated.

However, when I add the modules to this panel, it actually processes the unit test directories in addition to the regular project directories and puts the results of the unit tests processing in the production output.  Of course, this prevents the app from running correctly since those test classes are not in the production output (nor would we want them there!).

To add insult to injury, putting the modules into the "Processed Modules" list just about tripled the time it takes to build.

Suggestions?

10 comments
Comment actions Permalink

Hello Charles,

We are using the Service Provider interface (@ProviderFor) and have the mangosdk spi-0.2.4.jar in our classpath. In Idea 9, the
only thing we needed to do to get this annotation processor to produce the proper META-INF directory and files was to check off
"Enable Annotation Processing" in the Compiler->Annotation Processors panel. In Idea 10, I find I am required to add every module
of our project to the "Processed Modules" panel in order to get the META-INF to be generated.


The interpretation of annotation processor settings haven't changed in IDEA 10. If you haven't configured any modules in the list
below, your annotation processor won't be applied to the code directly by IDEA.
So I suspect that your processor worked not because you turned processing on in the dedicated settings, but because of javac's
processor auto-discovery feature.
This behaviour has indeed changed in idea 10, please see here why: http://youtrack.jetbrains.net/issue/IDEA-55836
In short, now when running javac, IDEA supresses auto-discovery and auto-run of annotation processors to avoid effects described in
the issue and to make processors runnig step more explicit.

Suggestions?


The quickest solution that looks logical to me is to tweak the current behavour so that suppressing of processors' autorun by javac
will be done only when "Enable annotation processing" option is turned on.
The logic behind this is that if explicitly configured, running auto-discovered processors can harm the whole build process. If
annotation processing stage is not enabled, than IDEA let things work according to default javac behaviour.
What do you think?

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"


"Charles C. Lloyd" <no_reply@jetbrains.com> wrote in message
news:28458151.348341292101819089.JavaMail.devnet@domU-12-31-39-18-36-57.compute-1.internal...

We are using the Service Provider interface (@ProviderFor) and have the mangosdk spi-0.2.4.jar in our classpath. In Idea 9, the
only thing we needed to do to get this annotation processor to produce the proper META-INF directory and files was to check off
"Enable Annotation Processing" in the Compiler->Annotation Processors panel. In Idea 10, I find I am required to add every module
of our project to the "Processed Modules" panel in order to get the META-INF to be generated.

>

However, when I add the modules to this panel, it actually processes the unit test directories in addition to the regular project
directories and puts the results of the unit tests processing in the production output. Of course, this prevents the app from
running correctly since those test classes are not in the production output (nor would we want them there!).

>

To add insult to injury, putting the modules into the "Processed Modules" list just about tripled the time it takes to build.

>

Suggestions?

>

---
Original message URL: http://devnet.jetbrains.net/message/5280483#5280483



0
Comment actions Permalink

Thanks for the reply Eugene.  However, I am not sure I understand your suggestion -- it sounds like you're saying that IDEA 10 will have to be modified to use the new behavior you describe.  Is there nothing I can pass to the compiler to override the supression?  I would be happy to try any suggestions like that since it would get us up and running sooner rather than later.

0
Comment actions Permalink

By the way, I can confirm that, after unchecking the "Enable Annotation Processing" in IDEA 9, the META-INF is created just as you thought, Eugene.  So it sounds like we're suffering because of the -proc:none being applied in IDEA 10.  I unchecked it in IDEA 10 and it doesn't work.  On a lark, I also tried added the following to "Additional Command Line Parameters" in IDEA10:

    -proc:org.mangosdk.spi.processor.SpiProcessor.java

... and it built, but did not produce the META-INF.

0
Comment actions Permalink

>applied in IDEA 10. I unchecked it in IDEA 10 and it doesn't work. On a lark, I also tried added the following to "Additional
>Command Line Parameters" in IDEA10:
>

This won't work because IDEA makes sure that processors are really disabled and filters user's input accordingly.  This will only
work after the modification to IDEA code I proposed above.
I can make a "special" build for you to be used until IDEA's minor release is out.

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"




0
Comment actions Permalink

A special build would be great to have.  Just let me know how to download it when you're ready and I'll give it a try.

0
Comment actions Permalink

Charles,
could you please send me your email and information about what downloads you need (for windows, mac, linux, community or ultimate
edition)


--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

"Charles C. Lloyd" <no_reply@jetbrains.com> wrote in message
news:31386016.362431292330749792.JavaMail.devnet@domU-12-31-39-18-36-57.compute-1.internal...
>A special build would be great to have. Just let me know how to download it when you're ready and I'll give it a try.
>

---
Original message URL: http://devnet.jetbrains.net/message/5280689#5280689



0
Comment actions Permalink

Eugene, we are having problems with the annotations processing once again for 10.5.x.  The only way I can get our project to build using 10.5.x is to "Enable Annotations Processing."  However, when I do this prevents the SPI annotation processor (which is apparently auto-discovered) from working properly and we do not get the META-INF output we need.  Once again, if I add each module to the "Processed Modules" list, it will work, but this is tedious and slows things down.  (We have over 60 modules in our project.)  This seems like a regression very similar to the issues we experienced with the initial 10.x version.

0
Comment actions Permalink

ANy news about this problem?

0
Comment actions Permalink

Well, I discovered that if I stoped using the "In-process compiler" that my problem went away, except now compile times are 4x.  I am able to use 10.5.x, but looking forward to a fix becuase its way too slow now.  However, I have heard nothing about any pending fixes.

0
Comment actions Permalink

I decided to try the IDEA 11 EAP version (Nika-IC-110.187.app) and the problem persists.

Eugene, were you able to reroduce the problem with the minimal project I sent you?

Regards,
Charles.

0

Please sign in to leave a comment.