简体   繁体   English

如何安装ANTLR 4.5.3工具罐进行Eclipse插件开发?

[英]how to install ANTLR 4.5.3 tool jar for eclipse-plugin development?

I need to use ST4 for my eclipse plugin development project. 我需要在我的eclipse插件开发项目中使用ST4。 As stated by antlr guys, the last version 4.5.3 is osgi ready and have st4 in his tool package. 正如antlr伙计所说,最新版本4.5.3已准备好在osgi中使用,并且在其工具包中包含st4。

How can I install it, so it appear in the dependencies list of my plugin manifest ? 如何安装它,使其出现在插件清单的依赖项列表中? Thanks. 谢谢。

Finally, I realized that : 最后,我意识到:
1. only the [ANTLR 4.5.3 Java runtime binaries jar] is OSGI ready. 1.只有[ANTLR 4.5.3 Java运行时二进制文件jar]可以使用OSGI。 the complete version is not OSGI ready. 完整版本尚未安装OSGI。
2. The StringTemplate-4 is not provided as tool in that binary bundle. 2.该二进制捆绑包中未提供StringTemplate-4作为工具。

To install the bundle in your plug-in is a matter of target-platform setup : 在您的插件中安装捆绑包是目标平台设置的问题:
3. Copy yours osgi bundles a choosen osgi directory. 3.复制您的osgi捆绑包,选择一个osgi目录。 eg: ./myProject/libs/osgi 例如:./myProject/libs/osgi
4. Open Eclipse preferences > Plug-in Development > Target Platform. 4.打开Eclipse首选项>插件开发>目标平台。
5. Select your current platform and press , then button. 5.选择当前平台,然后按,然后按按钮。
6. Select 'Directory source', then browse and select your osgi directory. 6.选择“目录源”,然后浏览并选择您的osgi目录。
7. Apply and close the preferences panel. 7.应用并关闭首选项面板。

You can now go to your plug-in dependencies and add those bundles to your project. 现在,您可以转到插件依赖项,并将这些捆绑软件添加到您的项目中。

Because my main need was to use ST4, I finally choose to add the following packages : 因为我的主要需要是使用ST4,所以我最终选择添加以下软件包:
- org.apache.servicemix.bundles.stringtemplate (4.0.8_1) -org.apache.servicemix.bundles.stringtemplate(4.0.8_1)
- org.apache.servicemix.bundles.antlr (3.5.2_1) -org.apache.servicemix.bundles.antlr(3.5.2_1)

and this worked for me. 这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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