Community
Participate
Working Groups
Given a Parsley project that also contains an Xcore model, it does not seem possible to define a binding that uses an Xcore-derived source resource within the DSL. Reproducer: * Create a Parsley DSL project using the new project wizard, unselecting the default option to create from a template. For this example, "reproducer" * In the 'src/reproducer' directory, create an Xcore file (Test.xcore) with the following: @GenModel(editDirectory="/reproducer/src-gen") package reproducer class Test {} * In the Parsley DSL, bind AdapterFactory to the EMF.Edit adapter factory generated by Xcore: import org.eclipse.emf.common.notify.AdapterFactory module reproducer { bindings { type AdapterFactory -> reproducer.provider.ReproducerItemProviderAdapterFactory } } Expected results: no compilation errors Actual results: compilation error: "Type mismatch: cannot convert from Class<ReproducerItemProviderAdapterFactory> to Class<? extends AdapterFactory>" * Copy the above adapter factory to the "src/reproducer" directory, importing "reproducer.providerTestItemProvider", and renaming it something else for clarification-sake, for example "ReproducerItemProviderAdapterFactory2" * Use this renamed class as the binding: import org.eclipse.emf.common.notify.AdapterFactory module reproducer { bindings { type AdapterFactory -> ReproducerItemProviderAdapterFactory2 } } Expected results: no compilation errors Actual results: no compilation errors
It doesn't seem to matter if the Xcore project is located within the Parsley project or not. I had a separate Xcore project and had the same import errors as the prior test above. Copying the factory to the Parsley project (& cleaning up its import) had the same effect as the latter test above.
Probably a stupid question but, do you export the package reproducer.provider in your Xcore project's MANIFEST.MF?
(In reply to Lorenzo Bettini from comment #2) > Probably a stupid question but, do you export the package > reproducer.provider in your Xcore project's MANIFEST.MF? Never a dumb question! Here's the code that's showing the error in Oxygen.0: https://github.com/jonpasski/eclipse-bug-519735. The xcore-edit has this in its MANIFEST.MF: Export-Package: xcore.provider The parsley project imports the type without any visual indication of an error, so I'm assuming the package exporting is correct.