Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsChanging output directory for code generated files with Xtext
https://www.eclipse.org/forums/index.php/mv/msg/677175/1276561/#msg_1276561
Is is possible to define the output directory (default "./src-gen") of the Xtext code generator to be the same, where the concrete syntax/grammar file (...mydsl) - which is processed/saved via the editor - is located?
If yes, can this be done in the <MyDsl>OutputConfigurationProvider (head.outputDirectory) or is there another approach within Xtext?
At the moment I can only configure it to be relative to the eclipse project path and this is not what I need.
Thank you for your help!]]>George Best2014-03-24T18:32:38-00:00Re: Changing output directory for code generated files with Xtext
https://www.eclipse.org/forums/index.php/mv/msg/677175/1276876/#msg_1276876
On the "Compiler" page, you can set preferences for the "output folder"
including the path of the output directory.
]]>Uli Merkel2014-03-25T06:14:50-00:00Re: Changing output directory for code generated files with Xtext
https://www.eclipse.org/forums/index.php/mv/msg/677175/1277002/#msg_1277002
George Best2014-03-25T10:35:42-00:00Re: Changing output directory for code generated files with Xtext
https://www.eclipse.org/forums/index.php/mv/msg/677175/1277061/#msg_1277061
I use it to make my output file similar to the input file with:
override void doGenerate(Resource resource, IFileSystemAccess fsa) {
var String scriptFileName = resource.getURI().lastSegment.toString();
var String outFileBase = scriptFileName.substring(0,scriptFileName.lastIndexOf("."));
fsa.generateFile( outFileBase + '.CIF',
makeTheCif(resource.contents.head as Model));
]]>Uli Merkel2014-03-25T12:38:55-00:00