Tim Ellison wrote:
A while ago we agreed to switch to a class library compilation story
that would allow us to use 1.5 Java syntax on a 1.4-compatible VM (i.e.
using syntax that is erased by the compiler).
Here's where I'm at...
Using the Sun compiler:
Specifying source=1.5 and target=1.4 (understandably) fails as an
invalid option set, but there is an undocumented and unmaintained option
that, AIUI, was introduced during the syntax transition to full 1.5
support. On Sun-based compilers we can specify source=1.5 target=jsr14
and get some support for erased 1.5 syntax.
Ok
Using the Eclipse compiler:
In the Eclipse JDT UI you *can* specify source=5.0 target=1.4 and I
successfully ran code written using generics on a 1.4 VM. However, the
Eclipse batch compiler does not allow this source=5.0 target=1.4
combination; and when I asked why the answer was that the UI usage is
wrong and will be fixed to prevent that combination.
LOL! How about suggesting that users find it useful right now?
Unless we void the warranty on the compiler by making non-API calls into
their code we cannot therefore use the Eclipse to do back-level
compilations.
Warranty? From Eclipse? <chuckle>
Geir voted -1 to the proposal if it meant that we could only use one
compiler, so I have looked around thought a bit more about it ...
Using RetroWeaver:
Retroweaver (retroweaver.sourceforge.net) is a bytecode weaver that
takes 1.5 class files and modifies them to run on 1.4-compatible VMs.
It is BSD-licensed.
The weaver does a bit more than we actually want in that it not only
rewrites the class file format (to remove class literals, synthetic
access specifiers etc) but also replaces references to some runtime
dependencies (replaces StringBuilder with StringBuffer,
Float.valueOf(float), etc.)
<geir runs away screaming>
[SNIP]
Comments?
Thanks for doing this.
It seems like we have two options - Sun and Eclipse, and because the
eclipse compiler is CDDL, and can be integrated into our build system,
we seem to be safe.
Sun isn't going to change, I'd bet, and in the event Eclipse does, we
simply fork it. :)
This really is a temporary situation. Maybe the thing to do is
1) get as much non-1.5 things done as possible this week or two (yes, I
know it's "Java 5" now, but calling it 1.5 is a good parallel to 1.4)
2) do a snapshot and also make a branch, for discussion sake call it
branch_1.4, which is unsupported and not an official objective of the
project
3) In head, get going w/ erasable 5 stuff under the assumption that
we'll be able to use Sun and Eclipse, for a while anyway.
4) If anyone feels sufficiently motivated, they can add to branch_1.4 if
we get more good code that we'd want to make available to the other 1.4
VMs out there, but again, it's not something we as a project would
commit to do - people could work on it as they see fit...
... ?
geir
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]