[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [SVN RFC] Making JavaHL easier to maintain?

From: Patrick Mayweg <mayweg_at_qint.de>
Date: 2004-09-05 15:22:28 CEST

Hi James,

David James wrote:

>Here's what Patrick wrote on Tuesday:
>
>
>>I would not considering it upgrading for javahl to use SWIG. From my
>>point of view generating the JNI header is no problem at all. I use an
>>ant script in my java ide for it. If I had to regenerate the SWIG code,
>>I always had to start a new working copy. That is much more of a problem.
>>
>>
>
>But doesn't SWIG offer benefits beyond generating the JNI headers?
>
>A quote from the SWIG documentation: http://www.swig.org/Doc1.3/Java.html
>"[Using SWIG] is different to using the 'javah' tool as SWIG will wrap
>existing C/C++ code, whereas javah takes 'native' Java function
>declarations and creates C/C++ function prototypes. SWIG wraps C/C++
>code using Java proxy classes and is very useful if you want to have
>access to large amounts of C/C++ code from Java. "
>
>The question is, how much will those capabilities benefit us?
>
>
I do not think very much for javahl. If you want to access the working
copy, file system or repository access libraries, it would be helpfull,
because you would have a much larger interface to cover. But do not see
that a target for javahl. I think that the clients for javahl will
mainly be gui's and ide plugin's.

When I started working on a java binding to subversion for svnup some
time ago, there was a very early swig binding by Alex Mller (xela). It
was not compileable and the generated classes did not look
object-oriented to me. There was a C++ binding also by Alex Mller in
the rapidsvn project, which I did like much better. Since I have written
JNI-interfaces in other projects, it was much easier and faster for me
to write a JNI-layer above the C++ binding, which I modified. For using
SWIG in that phase, I would have had to understand much more about swig
and the subversion client library. Like how to define a callback baton
in java, which will be called back by the client library or how to read
and write an apr-array.

The problem I have with SWIG lies mostly in the building system on
Windows, which did not seam to rebuild the generate code (C) after an
change in the source. This may be only a fixable problem. But for the
last time I have tried to compile any SWIG binding, it was a drag.

>Cheers,
>
>David
>
>
Patrick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Sep 5 15:22:48 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.