[Acceleo 3.1] fail to generate [message #698452] |
Tue, 19 July 2011 09:53  |
Eclipse User |
|
|
|
Since upgrading from 3.0 to 3.1.0.v20110607-0602 my Acceleo project has begun failing to generate. I get this message in the log:
The generation fail to generate any file because there are no model elements that matches at least the type of the first parameter of one of your main templates.
This same template worked fine in 3.0. The specific point of failure appears to be in AcceleoService in this block of code where it's looking for the main template to invoke:
for (Template template : mainTemplates) {
// Calls the template with each potential arguments
final EClassifier argumentType = template.getParameter().get(0).getType();
if (argumentType.eIsProxy()) {
throw new AcceleoEvaluationException(AcceleoEngineMessages.getString(
"AcceleoService.TypeIsProxy", templateName)); //$NON-NLS-1$
}
// The input model itself is a potential argument
if (argumentType.isInstance(model)) {
and specifically that last line:
if (argumentType.isInstance(model)) {
That line fails. 'model' there is the instance of my model that I passed into the constructor of my generator. And argumentType is a dynamic EClass that Acceleo is using to represent what should be the type of my model object. But they aren't matching up.
Perhaps in 3.1 I now need to override registerPackages in my generator and manually specify my model location? If so what should this look like for platform URIs? And is it needed for all packages in the model or just the root?
Some other noteworthy factors:
We refer to our model in the template using a platform uri, e.g.:
platform://a.b.c/model/mymodel.ecore
We're using CDO and EMF together in case that matters. And I'm passing in a pre-existing model instance to the generator, not a URI.
Also, looks like my Acceleo project's compiler settings are set to use binary resource. Not sure of the impact of that. That's what it was by default.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.15585 seconds