harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@pobox.com>
Subject Re: [tools] tools launching and javac
Date Thu, 25 May 2006 13:29:31 GMT

Tim Ellison wrote:
> This is still work in progress, but thought it would be good to give a
> quick update on where I am at the moment:
> - I've tweaked the launcher to support running Java-based tools.
> There are still some limitations (see below), but the idea is that if
> the launcher is running as 'java' or 'javaw' it does "the usual thing",
> but if it is running as another name it will:
>  (a) put tools.jar onto the classpath,
>  (b) deal with the -J args properly, and
>  (c) invoke a type called  org.apache.harmony.tools.<exename>.Main
> This means we can use the same launcher for all our Java-based tools.
> - I've implemented a wrapper to the Eclipse Compiler for Java(ECJ).
> The wrapper is called org.apache.harmony.tools.javac.Main, and I've put
> it into a 'tools' module.  The wrapper simply loads ECJ and delegates
> the compile requests.


> If you want to try using our new javac tool:
>  1. do a normal Harmony build
>  2. compile the modules/tools code into tools.jar
>  3. grab the Eclipse compiler (ant -f make/depends.xml download)
>  4. put the tools.jar and ecj_3.2RC5.jar into jre/bin
>  5. copy jre/bin/java to jre/bin/javac
> Now you can run javac.

Very cute!  Do you intend module/tools to remain not part of the build?

> Even better, if you want to help me complete it (or start work on
> another tool) here are the things left to do/limitations:
>  - Since our launcher can switch VMs on the command line it assumes the
> VMs are directly accessible in subdirectories, so the launcher only
> works in jre/bin, not from a jdk-style bin directory.  Fixing this
> requires a simple library load path tweak in the launcher code, and very
> possibly dealing with the harmony.properties messages.
> - For now, the o.a.h.tools.javac.Main wrapper looks for the compiler in
> a hard-coded JAR filename (ecj_3.2RC5.jar).  Just wondering whether to
> embed that JAR in the tools.jar, or look for the compiler in *.jar, or ...?

Can we give it a 'known' pattern like "harmony_javac_ecj_3.2rc5.jar" or 
such so we can mechanically find it w/o a long search, yet also remember 
the version that we're using?

> - Once I've flushed out any remaining bugs I need to hook the tools
> module into the build system so that tools.jar gets built along with
> everything else.

That answers the question above... :)

> - The launcher code needs some love, IMHO it could be cleaned up quite a
> bit.
> Just shout if you want to take on some of this stuff with me, you'd be
> warmly welcomed <g>.
> Regards,
> Tim

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message