2

I am developing an scripting environment for EMF and need to import the model plugin so that my script is able to use classes generated by the model, but in order to do that I need to explicitly add the plugin to my imports.

Can I do that automatically? Like adding all workspace plugins to my imports at runtime?

herculanodavi
  • 228
  • 2
  • 12

1 Answers1

2

You can use DynamicImport-Package: * attribute in the bundle manifest to make all exported packages visible.

Note that packages imported via DynamicImport-Package are resolved every time a class from the package is needed. Consider selective dynamic import DynamicImport-Package: *;dynamic=mymodel or buddy policy as better alternatives.

Jarek Przygódzki
  • 4,284
  • 2
  • 31
  • 41
  • Thanks for the tip! What I did was parsing all bundle manifests and then getting the classLoader which had the class. Then I would load the class, add it into a HashMap that my actual ClassLoader has. This way you would call the class only once. Also, with your tip my script engine works faster – herculanodavi Apr 15 '16 at 13:54