Search code examples
eclipse-pluginantlr4stringtemplate-4

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


I need to use ST4 for my eclipse plugin development project. As stated by antlr guys, the last version 4.5.3 is osgi ready and have st4 in his tool package.

How can I install it, so it appear in the dependencies list of my plugin manifest ? Thanks.


Solution

  • Finally, I realized that :
    1. only the [ANTLR 4.5.3 Java runtime binaries jar] is OSGI ready. the complete version is not OSGI ready.
    2. The StringTemplate-4 is not provided as tool in that binary bundle.

    To install the bundle in your plug-in is a matter of target-platform setup :
    3. Copy yours osgi bundles a choosen osgi directory. e.g.: ./myProject/libs/osgi
    4. Open Eclipse preferences > Plug-in Development > Target Platform.
    5. Select your current platform and press , then button.
    6. Select 'Directory source', then browse and select your osgi directory.
    7. Apply and close the preferences panel.

    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 :
    - org.apache.servicemix.bundles.stringtemplate (4.0.8_1)
    - org.apache.servicemix.bundles.antlr (3.5.2_1)

    and this worked for me.