I am working on a large old code base that currently only compiles with java 1.4. One of the things I need to do is get it to work with 1.6 (probably 1.7 now).
The head assembly is not currently compiled with 1.6. There are many reasons for this - most of them are easy to fix, for example, using enum as a keyword, but we are struggling with Oracle / Sun updating JDBC (connection interface) to support types not available in java 1.4. This means that if I make changes to work with 1.6, the main production assemblies are broken down into classes such as NClob break, because they are not in version 1.4; if I do not make changes, I cannot compile with the 1.6 compiler.
Are there templates to support conditional compilation / assembly in java? My only plan I have come up with so far is to mess around with the ant construct for conditionally replacing I / O classes depending on the assembly. It feels pretty awful, so the community asks about it here.
Again, the boundaries of the problem are:
- You need to be able to continue compiling
HEAD on 1.4 (there is no version 1.6 with 1.4 compatibility modes, I'm afraid) - We also need a separate head assembly, which compiles with 1.6 - the assumption is that it will take some time (since this is a large code base), therefore, the first point of the marker will allow others to continue working and deliver other changes during preparation. The head is built for compatibility since 1.6.
- This is one massive tree of code; this means that none of our codes is library dependent, and we cannot do it this way (remember: the base code base
:( ) - We do not allow branching (for the reason I will not go into it if I really do not have to)
Thank you very much in advance.
source share