You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Richard Beton <ri...@roke.co.uk> on 2000/11/14 14:03:54 UTC

Javah Task

Stefan Bodewig wrote:

> Richard Beton <ri...@roke.co.uk> wrote:
>
> > I now have a javah task. Who might I send it to for inclusion in
> > future versions of Ant?
>
> ant-dev@jakarta.apache.org is the canonical place for patches and code
> contributions.

Please find new javah attached. It was based on the javac task. I have
commented out the extdirs stuff, because I was not quite sure what was
needed. Also, note that unlike the javac task, javah does not use
reflection to call the com.tools constructor, but simply uses the 'new'
operator. Therefore, when the verbose flag is passed to javah, text output
goes to standard output rather than via the ant logging stream.

This javah task has been tested against JDK1.3 and JDK1.2 (new and old JNI
formats). I don't think it works with JDK1.1 or JDK1.0. JDK1.1 tools
appear not to be pure Java, but rather binary executables.

Rick



Re: Javah Task

Posted by Stefan Bodewig <bo...@bost.de>.
Thanks for your contribution Richard, it usually takes a little time
until one of us committers finds time to review a task, comment on it
and finally maybe incorporate it into Ant.

Richard Beton <ri...@roke.co.uk> wrote:

> Also, note that unlike the javac task, javah does not use reflection
> to call the com.tools constructor, but simply uses the 'new'
> operator.

If we'd want to leave it that way, it would become an optional task
that requires JDK 1.2+, which might be perfectly OK as it doesn't
support JDK 1.1 style JNI. At least this is how I understand your
description.

> Therefore, when the verbose flag is passed to javah, text output
> goes to standard output rather than via the ant logging stream.

Which means it needs to be redirected, see the handling of
System.out/.err in <java> or <javac> when using the modern compiler.

Stefan

Re: Javah Task

Posted by Stefan Bodewig <bo...@apache.org>.
Richard Beton <ri...@roke.co.uk> wrote:

> This javah task has been tested against JDK1.3 and JDK1.2 (new and
> old JNI formats). I don't think it works with JDK1.1 or
> JDK1.0.

No it doesn't, therefore I've moved the task to optional (and it will
be conditionally compiled on jdk1.2+).

> JDK1.1 tools appear not to be pure Java, but rather binary
> executables.

I think you are right here - if anybody feels so inclined and submits
code to invoke binaries for javah as well, we could make the package
complete.

Almost forgot the usual "please submit documentation".

Thanks

        Stefan