I have a XText project within Eclipse, with my own grammar file implemented. Using the doGenerate function I generate several .java files. So far everything works like a charm.
My problem is that every time I generate my files I need to do the following:
- Copy the generated files to my Eclipse projects directory
- Create a new Java project in Eclipse
- Import the generated files to the project
I would like to be able to make any or all of these steps automatic every time the doGenerate function is called, so is there a way to do just that with xtend/java code? I should mention that my grammar requires the user to specify the project directory + name, so that info is available at runtime from within the doGenerate function.
The code should preferably be able to detect if there is already a project with the same name, and update it's contents within the open Eclipse instance at runtime if such a thing is possible.
Alternatively, if this cannot be done with xtend/java, can this be done with a plugin?