Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Generated Files do not auto-compile
Generated Files do not auto-compile [message #1801618] Wed, 23 January 2019 11:09 Go to next message
Eclipse UserFriend
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 11:13 Go to previous messageGo to next message
Eclipse UserFriend
This does not work in Xtext. you could introduce a second builder that touches the B files that we generated
Re: Generated Files do not auto-compile [message #1801621 is a reply to message #1801619] Wed, 23 January 2019 12:45 Go to previous messageGo to next message
Eclipse UserFriend
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 07:44 Go to previous messageGo to next message
Eclipse UserFriend
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 09:21 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Generated Files do not auto-compile [message #1801687 is a reply to message #1801671] Thu, 24 January 2019 12:37 Go to previous message
Eclipse UserFriend
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: Tue Jun 24 01:17:21 EDT 2025

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

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

Back to the top