Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Accessing the `IBuildContext` from the `IShouldGenerate`(TLDR; run the generator only if a clean build was triggered by the user)
Accessing the `IBuildContext` from the `IShouldGenerate` [message #1787227] Tue, 22 May 2018 11:28 Go to next message
Akos Kitta is currently offline Akos KittaFriend
Messages: 1
Registered: April 2018
Junior Member
I would like to run the generator only when a clean build was explicitly triggered from Eclipse. In other words; no generation should run after saving the editor. The `BuilderParticipant` has the `shouldGenerate` service that I can customize, and that seems to be a perfect location to bail the generation. Unfortunately, the `IShouldGenerate`'s `shouldGenerate(Resource, CancelIndicator)` method lacks the `IBuildContext` information. Is there a way to customize either the `BuildParticipant` or the `IShouldGenerate` implementation to be able to access the `BuildType` information from the build context? So I can avoid running the generator. But I would be happy with any other approaches as well. Thanks!
Re: Accessing the `IBuildContext` from the `IShouldGenerate` [message #1787456 is a reply to message #1787227] Fri, 25 May 2018 16:21 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12239
Registered: July 2009
Senior Member
id propose to use a custom subclass of BuilderParticipant and use a custom shouldgenerate impl

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Errors creating Xtext Project From Existing Ecore Models
Next Topic:Multiple generators
Goto Forum:
  


Current Time: Mon Sep 24 23:01:14 GMT 2018

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

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

Back to the top