Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » External dependencies with Xtext builder
External dependencies with Xtext builder [message #991648] Wed, 19 December 2012 17:58 Go to next message
Zoltan Ujhelyi is currently offline Zoltan Ujhelyi
Messages: 208
Registered: July 2009
Senior Member
Hi,

we are developing an Xtext-based language, that refers to a project-specific configuration file, that describe referrable resources. We have a custom scoping implemented, that uses the information during parse and everything works as expected.
However, we noticed that Xtext does not track this dependency information automatically, so changing the file never triggers a rebuild of the dependent files.

I have experimented a lot with various services, but did not find a solution satisfying to us. I am reasonably sure, I did not model everything during scoping as Xtext expects, but I would like to try to solve the issues without breaking our existing implementation too much.

My question is two-folds:

1. Is it possible to provide a service that allows the manual specification of such dependencies - either by rebuilding the entire project if the configuration file changes or by directly connecting the files programmatically.
2. Or if the first solution is not supported and/or is impractical, can you tell me what is the recommended way to specify various extra EMF resource locations to use during scoping.

Thank you for your help,
Zoltan
Re: External dependencies with Xtext builder [message #992115 is a reply to message #991648] Thu, 20 December 2012 17:41 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2499
Registered: July 2009
Senior Member
On 2012-19-12 23:58, Zoltan Ujhelyi wrote:
> Hi,
>
> we are developing an Xtext-based language, that refers to a
> project-specific configuration file, that describe referrable resources.
I do something similar in cloudsmith / geppetto @ github. I have a model
of the runtime (in my case called .pptp) that is stored as an ecore
file. In addition, I parse ruby files that are in the workspace and
dynamically build .pptp models from those).

It is mostly a matter of registering the appropriate resource
descriptions and parsing/making the model available.

In my case I don't use the normal Xtext/EMF linking and thus I register
all the required information for rebuilding manually. If you use normal
links that should be done automatically for you once the framework is
aware of the relationship between your file and a model that you have
references to.

> We have a custom scoping implemented, that uses the information during
> parse and everything works as expected. However, we noticed that Xtext
> does not track this dependency information automatically, so changing
> the file never triggers a rebuild of the dependent files.
> I have experimented a lot with various services, but did not find a
> solution satisfying to us. I am reasonably sure, I did not model
> everything during scoping as Xtext expects, but I would like to try to
> solve the issues without breaking our existing implementation too much.
>
> My question is two-folds:
>
> 1. Is it possible to provide a service that allows the manual
> specification of such dependencies - either by rebuilding the entire
> project if the configuration file changes or by directly connecting the
> files programmatically.
You can do this manually if you want. The solution in Geppetto may be
overkill for you (start at the PPLinker if you are interested, but there
is quite a lot of code to read).

> 2. Or if the first solution is not supported and/or is impractical, can
> you tell me what is the recommended way to specify various extra EMF
> resource locations to use during scoping.
>
I have read blog posts describing how to have references to "other EMF
models" - also believe that this has been asked earlier in this forum,
try searching. (Or someone may have links to info more handy perhaps...).

Also, you can look at how I wire up support for the PPTP model in Geppetto.

Hope that helps
Regards
- henrik
Re: External dependencies with Xtext builder [message #992492 is a reply to message #992115] Fri, 21 December 2012 14:33 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan Ujhelyi
Messages: 208
Registered: July 2009
Senior Member
Hi Henrik,

thank you for the pointer. Seems a usable way - at least now I see what I am supposed to override if all else fails.

Currently, I am rather thinking about providing a solution inside the Xtext scoping mechanism, but for now, I am laying the issue rest a few days. Maybe after that everything will become clearer.

Thank again,
Zoltán
Previous Topic:Maven Xtend compiler - file encoding
Next Topic:Intermittent Validation Job failures on editor close
Goto Forum:
  


Current Time: Sat Aug 30 02:31:24 EDT 2014

Powered by FUDForum. Page generated in 0.01507 seconds