Grammar Mixins/Library vs. Tycho/Maven build [message #1768014] |
Wed, 12 July 2017 21:20 |
Volker Wegert Messages: 182 Registered: July 2009 |
Senior Member |
|
|
Hi all,
I have run into some trouble that I don't really know how to untangle. The project I'm working on contains multiple .xtext files - one is a "library" that contains nearly all of the language elements, the other ones import that library and simply define different top-level expressions to represent different objects from that language in different files. The latter files are the ones that are actually define the "concreate languags" and are used to generate the editors and other stuff, very similar to the situation described in https://eclipse.org/Xtext/documentation/301_grammarlanguage.html#grammar-mixins.
In the .mwe2 file, the "library" language is listed first, followed by the other languages. The manual build process (executing the .mwe2 file) appeared to work well for a time - I now realize that it did because I created and compiled the library first and added the concrete language files later on, so that the library.genmodel file was already present at the time the first concrete library was added.
Now I've started to use Maven/Tycho for this project and promptly ran into an issue: Some component cleans out the generated .ecore and .genmodel files from /model/generated before the .mwe2 workflow is executed. (I've already removed the directory from the maven-clean-plugin configuration in the POM, but the files are still deleted - I haven't yet figured out which component is responsible for that, but that isn't my main issue since relying on a pre-existing and probably outdated .genmodel file is not what I want to achieve.) I somewhat naively expected the files to simply be re-generated, but it doesn't appear to be that simple.
From what I understand, the .genmodel file of the library is required to interpret the concrete languages, and since it was deleted, the entire .mwe2 workflow fails to execute with "Couldn't resolve reference to Grammar/EPackage" messages. I believe that I need to separate the workflow into two parts, but I haven't yet been able to figure out how to do so and keep the stuff that generates the language-independent stuff (like the plugin components, tests and other stuff) working. https://eclipse.org/Xtext/documentation/350_continuous_integration.html does not appear to contain information relevant to this case (and appears to be outdated, since it still uses URI references to the language files while the wizard already generates name references... am I right...?) I would be very grateful for some pointers on how to handle this dependency problem.
Thanks in advance
Volker
|
|
|
Re: Grammar Mixins/Library vs. Tycho/Maven build [message #1768021 is a reply to message #1768014] |
Thu, 13 July 2017 05:10 |
|
i wonder what you are exactly doing. my simple example with one workflow works fine
language = StandardLanguage {
name = "org.xtext.example.mydsla.MyDslA"
fileExtensions = "mydsla"
serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
}
language = StandardLanguage {
referencedResource = "${rootPath}/org.xtext.example.mydsl/src/org/xtext/example/mydsla/MyDslA.xtext"
name = "org.xtext.example.mydslb.MyDslB"
fileExtensions = "mydslb"
serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04006 seconds