|Command line use of Xtext [message #1009166]
||Thu, 14 February 2013 15:16
| Jos Warmer
Registered: October 2010
I am looking for the possibilities to run Xtext and generators from the command line. There is a multitude of issues involved, some of which I already solved. I have no solution yet for the following two issues
- Cleaning the output. Xtext uses OutputConfigurationProviders to set the output folders and set properties whether or not to clean the output folders. The directory cleaned workflow component is not aware of these p[roviders. To work correctly with Xtext there should be an XTextClean() workflow component that uses the information from the OutputConfigurationProviders to clean the folders that it should clean. Does anyone has such a component, or should I write it myself ?
- The Xtext Index iside Eclipse allows me to get access to global information. In a generator I need to generate a list of all model elements of a specific type. These elements may be defined in multiple Xtext files. The only way I see to solve this problem is to access the Xtext Index, which holds information from every Xtext file in its index. However, I have not found how I can access the Xtext Index outside Eclipse. Did I miss something ? Or is this not possible ?
For the following two issues I have found or developed a solution.
- Run Xtext on a collection of files that have references to each other using fully qualified names. One Xtext file is easy, but to work with multiple files, there is a need to first ensure that all Xtext files are put into the same resource set. In Spray we wrote our own ReaderExt.java workflow component doing exactly this. I adapted this solution for my current project.
- Running the language formatter on the generated output. I generate output which itself is in a language implemented by Xtext. I want to run the Xtext generated formatter on this generated models. I found no way to run the Xtext formatter from the command line, therefore I developed my own workflow component that runs the Xtext formatter on the generated files.
Did anyone encounter the same questions and has pointers to solutions?
In general it would be great if Xtext would generate everything needed for command line execution out of the box, similar to the way it provides such excellent support for running inside Eclipse.
Powered by FUDForum
. Page generated in 0.12460 seconds