xtext replace "scr-gen" directory [message #1067183] |
Sun, 07 July 2013 10:13 |
Eathen Saw Messages: 11 Registered: July 2013 |
Junior Member |
|
|
I use xtext to generate code (XML-Schema), My problem is, that the framework uses the "src-gen" as output by default. I would like to change the outputfolder according to a given path by user in DSL programmatically. The output folder could be any where, in the same project which contains the DSL, or any other Eclipse project.
For detail description see the following example:
Assume I have 2 Eclipse projects A and B. Projekt A contains the DSL-file, where the user specifies the path for the output directory. When the user edits and saves the DSL file, I would like to get the path to the output folder programmatically and replace the default output folder "src-gen".
Now I have 4 questions:
1. What is the easiest way to define the path to the new outputdirectory in the grammar?
2. How do I access the path defined by user?
3. How can I replace the default output directory "src-gen" (programmatically)?
4. Should I do the step asked in question 3 once or twice if I want to solve the problem in the runtime instance of Eclipse and for a deployed plugin?
I am sorry, if I ask to much, I tried a lot and could not solve my problem.
I appreciate your help. Please give, if possible detailed information and code example
Thanks in advance
|
|
|
Re: xtext replace "scr-gen" directory [message #1067197 is a reply to message #1067183] |
Sun, 07 July 2013 13:35 |
|
Hi,
i am not quite sure what this question is targeting.
in the default setup
you can open a projects (the one the .mydsl file is contained) properties. then go to "MyDsl -> Compiler" there you can specify besides other stuff the output dir.
the code magic on this is in org.eclipse.xtext.generator.IOutputConfigurationProvider (org.eclipse.xtext.builder.EclipseOutputConfigurationProvider in running eclipse)
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05385 seconds