简体   繁体   中英

How to write plug-ins for eclipse (CDT) using C++

our current C++ project is developed using normal text editors (no IDE used). It was recently put onto eclipse with CDT. Now, there is a need to develop new plugins for our project (a C++ proj). Need to know which is the best approach to develop plug-ins for eclipse(CDT)

I heard the possible way is Jave PDE-->JNI-->C++. Can anyone help me to write a plugin for eclipse in c++.

In general, the best approach for developing plugins is to use a JVM language that can extend Java classes, implement Java interfaces, and instantiate and invoke methods in Java objects—notably Java.

Once you have that, you could delegate parts of the implementation using whatever technology you wish, such as JNI, JNA, RMI, LuaJ, Jace etc. It would be no different for an Eclipse plugin than any other program. The problem being the degree to which the delegated code has to callback into the JVM to do it's job.

In the trivial and near trivial cases, a plugin doesn't need any code but, obviously, it's contribution would be quite limited. One example is providing documentation. It all depends on what extension points it uses require.


But, if all you want is a project Builder that doesn't need to integrate much with CDT, you might not need your own plugin to do it. Eclipse provides an Ant builder and an External Program builder. See this article . With either of them, you could do things like code generation, inspections, or packaging.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM