Background: Suppose you have a project with lots of modules; some of them are new and maintained, some of them are old code and aren't touched unless neccessary. Some of those new modules are written against JDK 1.5, taking advantage of all the new language modules, and these depend on otherwise stable "library" modules, which are being slowly modified to take advantage of some new features (generics in particular).
The Retroweaver Plugin supports a different set of options for each module since the 1.2 release, which seems like a great boon to a project like this. Everything would work, if IDEA called the plugin in the correct order, but it doesn't.
Making things a little more concrete, here are the modules, and their configuration:
- lib_backend: A shared library, used by both new and old modules. This module takes advantages of the 1.5 new language features, but doesn't use any new API's.
- web_interface: A web application, designed to run under Weblogic 8.0 (and thus, JDK 1.4). No 1.5 language features or API's are used.
- backoffice: A standalone, JMX-managed application written with all bells and whistles of JDK 1.5
In the perfect world, the retroweaver configuration for these modules should have been:
- lib_backend: Compile with 1.5, retroweave to 1.4
- web_interface: Compile with 1.4, no retroweaving
- backoffice: Compile with 1.5, no retroweaving
Now the important part: IDEA will compile the modules in the correct order (lib_backend first, then the others), but will only call additional compilers (like the one contributed by the retroweaver plugin) after all modules have been compiled. This poses trouble because the lib_backend classes won't be retroweaved by the time the web_interface compilation starts, and the JDK 1.4 compiler will complain about wrong class versions.
As a temporary workaround, I've set the web_interface module to compile with 1.5 and retroweave to 1.4, but since the module doesn't use any 1.5 features itself, I didn't want to have to do that.
JetBrains, is there anyway the Retroweaver compiler (a ClassInstrumentingCompiler) could be called after each module (or module group, in the case of circular dependent modules) is compiled? Or any other way to make it work as explained above?