|
|
Re: Call methods that need plugin's resource factory from launch configuration [message #1245417 is a reply to message #1245331] |
Thu, 13 February 2014 14:42   |
Eclipse User |
|
|
|
Hi,
EMF 2.9 added a very handy utility: EcorePlugin.ExtensionProcessor,
which scans the classpath for plugin.xml files and parses them into an
instance of the Equinox extension registry to automatically load all of
EMF's extension points. It requires a small part of the Equinox
footprint at run-time, but is quite convenient. And, in 2.10 (Luna)
release, it will also work on non-Windows platforms!
Cheers,
Christian
On 2014-02-13 16:54:11 +0000, Felix Dorner said:
> On 13/02/2014 16:42, Chris Gerpheide wrote:
>> "Cannot create a resource for 'myURI.mymetamodel'; a registered resource
>> factory is needed.
>>
>> I guess this happens because the menu-command takes advantage of any
>> preloaded resource factories from plugins insalled in my instance,
>> whereas calling my plugin code from a run configuration is more...
>> blackboxed.
>
> Yes this is just running your plugin-code in a standalone context. Your
> metamodels are registered via plugin extension points which are of
> course not available in standalone. So you would have to register your
> factory manually, I think simply accessing the generated EPackage would
> do. I wonder if QVT wouldn't already provide such a custom launch
> configuration type... At least JET does and I'm quite sure that
> Acceleo3 would too.
>
> Felix
|
|
|
Re: Call methods that need plugin's resource factory from launch configuration [message #1245845 is a reply to message #1245294] |
Fri, 14 February 2014 05:48  |
Eclipse User |
|
|
|
Thank you for your answers!
@Felix, Indeed there is a QVTo launch configuration. But in my case I don't want the configuration to directly call QVTo, but rather a Java file (which happens to execute a QVTo transformation, but also does other things). Thank you for the explanation though, it clarifies what's happening.
I have found a way that looks like it may work though, which is instead of using the Java application launch configuration, going ahead and creating my custom launch configuration, where my calling-qvto-transformation Java code is inside the launch method of my LaunchConfigurationDelegate implementation. I haven't figured out all the pieces of it, but it at least looks like then all my plugin metamodels are still accessible to my code.
@Christian That sounds very handy indeed. For my purposes adding to the footprint is not a problem, so I will look into this (and I do currently use Windows). It may give me more options for how I run my code.
|
|
|
Powered by
FUDForum. Page generated in 0.04357 seconds