At 06:16 2003-04-24, Jeffrey Dever wrote:
I am considering adding support for JNI programming. The initial
goals would be to provide awareness of javah, association of classes
with native methods and the associated C/C++ implementation and
command completion of JVM functions through the env pointer.
I'm seeking advice. Has any work been done in this direction? Would
this be considered for CDT or better as an independent plugin? Would
anyone (other than me) find this useful?
Most definitely so! :-) I've also been thinking a lot of how to use
CDT with JDT to facilitate JNI. Unfortunately, I can't spend much time
developing any such plugin, so my contribution is limited to coming
with ideas, and testing. :-(
I think the idea of JNI support in CDT has been mentioned briefly on
the list (or possibly the newsgroup) before, but not more than on the
level of "gee, that sounds like a good idea".
As I see it, a JNI support plugin breaks down to two categories:
JDT/CDT namespace connection, and build support. Some examples of what
I mean:
Namespace connection:
* You should be able to make a "JNI connection" between a CDT and a
JDT project. (Perhaps, if it's possible, you should have a single
project with dual "natures".)
* You should be able to go to the C implementation of a native
declared method from JDT.
* You should be able to go to the java native declaration from a C
implementation in CDT.
* It should be trivial to create a JNI implementation fuction stub
(basically, get the name right :)) from a java native method declaration.
* Rename refactoring of either the native declaration in Java or the
C implementation should rename the other element, too.
* C functions with "JNI-style" names which doesn't correspond to a
native declaration in Java should (optionally) result in a warning
* If a Java project is "JNI-connected" with a CDT project, then Java
native method declarations which does not have a CDT implementation
should result in a warning
* Arguments to JNI functions (the env-pointer ones) which correspond
to Java elements (class, method, field names) should have "command
completion" from the corresponding Java project name space.
Build support:
* Running javah automatically when Java source code changes.
* Help the user get all library paths correctly
However, I don't really think that command completion of JNI functions
from the env-pointer is a JNI issue. After all, the JNIEnv is just a
pointer to a plain C struct with function pointers. There's nothing
special in that. CDT should be able to do command completion on that,
and on all other similar constructs. That being said, it is of course
more important to make sure that CDT does that in a correct way when
you're developing JNI code -- after all, it's not a commonly used
construct. :-)
/Magnus
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-dev