|
|
|
|
|
|
|
|
Re: Is there a recommended way to turn the inferred Ecore model into imported one? [message #1810950 is a reply to message #1810948] |
Thu, 22 August 2019 15:38 |
Alexei Adamovich Messages: 9 Registered: May 2013 |
Junior Member |
|
|
Christian, I am not very fluent with .mwe2 workflow specification language.
After moving the .ecore and .genmodel files to the model/custom directory and following other steps that Lorenzo Bettini described in second edition of his book, I got a situation, where I can use that inferred model as the imported one. But should regenerate model code by hand each time I change the model.
One of the final steps in the Lorenzo's procedure was adding something like
referencedResource ="platform:/resource/org.example.customgreetings/model/custom/Greetings.genmodel"
after the
language = StandardLanguage {
name = "org.example.customgreetings.Greetings"
fileExtensions = "greetings"
piece into the .mwe file.
Than I have tried adding the following line
fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment2 auto-inject {}
immediately after the "referencedResource" line.
But seems, that doesn't turn the automatic model code generation on. Can you give me a clue, what lines and where should I add to the workflow? Is it possible that the source of problem is in my choice of the default build system when I was setting up the project?
And also is there any source of information on the mwe2 automagic related to the Xtext?
Thanks for your patience,
Alexei
[Updated on: Thu, 22 August 2019 15:42] Report message to a moderator
|
|
|
|
|
Re: Is there a recommended way to turn the inferred Ecore model into imported one? [message #1810957 is a reply to message #1810952] |
Thu, 22 August 2019 16:27 |
Alexei Adamovich Messages: 9 Registered: May 2013 |
Junior Member |
|
|
Thanks, Christian,
finally I got it!
Now model code is regenerated during each run of the .mwe2 workflow.
For other interested: to get imported model code regenerate each time I run the .mwe2 workflow, I have made the following changes in the .mwe2 file:
1. Added
import org.eclipse.emf.mwe2.ecore.EcoreGenerator
2. After the import section I have added line like
var projectName = "org.xtext.example.mydsl"
before the Workflow section
3. In the Workflow section body after the specification of the XtextGenerator component
component = XtextGenerator {
...
}
I have added the lines like
component = EcoreGenerator {
genModel = "platform:/resource/${projectName}/model/custom/MyDsl.genmodel"
srcPath = "platform:/resource/${projectName}/src"
}
Thats all!
Thanks for your replies and advices!
Alexei
[Updated on: Sat, 24 August 2019 14:11] Report message to a moderator
|
|
|
Re: Is there a recommended way to turn the inferred Ecore model into imported one? [message #1810959 is a reply to message #1810955] |
Thu, 22 August 2019 16:42 |
Alexei Adamovich Messages: 9 Registered: May 2013 |
Junior Member |
|
|
Hi, Ed.
Possibly I expressed it incorrectly.
First, I wanted to edit the .ecore model by hand. So I don't need .ecore and .genmodel be generated automatically from the grammar specification.
This goal was reached by using the procedure that is described by Lorenzo Bettini in the second edition of his book.
Second, I prefer that the Java packages, that are produced by Ecore generator ouf of .genmodel/.ecore files, be regenerated automatically during each run of the .mwe2 workflow.
This was made by adding the EcoreGenerator component specification to the .mwe2 file.
Regards,
Alexei
[Updated on: Thu, 22 August 2019 16:47] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03916 seconds