Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generated Files do not auto-compile
Generated Files do not auto-compile [message #1801618] Wed, 23 January 2019 16:09 Go to next message
Konrad Jünemann is currently offline Konrad JünemannFriend
Messages: 31
Registered: December 2018
Member
Hello,

I have two (related) "layered" DSLs, DSL_A and DSL_B. When A files are compiles, B files are generated. Together with other, user-defined B files, they should then be compiles again to generate C-files (simple text files).

I am using the classpath approach proposed in the Xtext book to compile files, i.e., only files on the classpath are deemed visible.

The files are stored as follows:
MyProject
-> A_files/src/ ... <-- user-defined A-files are stored here
-> B_files/src/ ... <-- user-defined B-files are stored here
-> B_files/src-gen/ ... <-- generated B-files are stored here
-> C_files/ ... 


All src and src-gen Folders are configured as source-folders.

My problem is that generated B_files are not parsed automatically after generation, i.e., the EMF Index contains none of the generated B-elements. This problem also occurs after a clean build.

In order to compile the B files a have to remove and add the B_files/src-gen/ folder manually.

How can I ensure that generated B-files are parsed automatically after being generated?
Re: Generated Files do not auto-compile [message #1801619 is a reply to message #1801618] Wed, 23 January 2019 16:13 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
This does not work in Xtext. you could introduce a second builder that touches the B files that we generated

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generated Files do not auto-compile [message #1801621 is a reply to message #1801619] Wed, 23 January 2019 17:45 Go to previous messageGo to next message
Konrad Jünemann is currently offline Konrad JünemannFriend
Messages: 31
Registered: December 2018
Member
Ok. Thanks for clearing that up!
Re: Generated Files do not auto-compile [message #1801666 is a reply to message #1801621] Thu, 24 January 2019 12:44 Go to previous messageGo to next message
Konrad Jünemann is currently offline Konrad JünemannFriend
Messages: 31
Registered: December 2018
Member
Follow-up Question:

Would a good approach be to introduce a second Builder (as you recommended), giving the first Builder only a BuilderParticipant for *.Adsl - files and the second builder only one for *.Bdsl-files? The idea being that the first builder only compiles A files while the second one compiles B files. As the builders are independent, they should both receive all ResourceDeltas, correct?

Re: Generated Files do not auto-compile [message #1801671 is a reply to message #1801666] Thu, 24 January 2019 14:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
no you need only a builder for the file extension that is generated. in this case the .bdsl files.
the xtext builder builds both.
the new builder just touches b.dsl files so that xtext seems them


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generated Files do not auto-compile [message #1801687 is a reply to message #1801671] Thu, 24 January 2019 17:37 Go to previous message
Konrad Jünemann is currently offline Konrad JünemannFriend
Messages: 31
Registered: December 2018
Member
I tried your apporach and it works like a charm. Thanks for your help!
Previous Topic:Building Xtext out of the box with maven fails on photon
Next Topic:Customize the inserted value from auto-complete from the proposed
Goto Forum:
  


Current Time: Fri Aug 23 22:54:25 GMT 2019

Powered by FUDForum. Page generated in 0.02231 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top