Chaining of code generators [message #1690092] |
Wed, 25 March 2015 04:46  |
Eclipse User |
|
|
|
Hi,
I have the following use case with two DSLs:
- Grammar Foo (inherits from Xbase)
-- file extension: *.foo
-- FooGenerator generates a *.java file in src-gen folder
- Grammar Bar (inherits from Xbase)
-- Bar is a high level abstraction language for Foo
-- file extension: *.bar
-- BarGenerator generates a *.foo file in src-gen folder
The intention is that for every *.bar file there is a *.foo file and a *.java file.
Unfortunately saving a *.bar file does not trigger the XtextBuilder for the generated /src-gen/*.foo file and the *.java file is therefore never generated.
Is there any way to configure the builder to be triggered for the *.foo file?
I understand I can inject the FooGenerator into the BarBenerator. However I'm not sure whether this approach is appropriate usage of Xtext code generation.
Thanks,
Nils
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Chaining of code generators [message #1690599 is a reply to message #1690598] |
Sun, 29 March 2015 14:55   |
Eclipse User |
|
|
|
Hi,
i still do not get your problem: if you do a build on file a the isaffected for file b will be called during that build. and if isaffected returns true, the file b will be build as well
here is the stacktrace from my example
MyDslBRDM.isAffected(Collection<Delta>, IResourceDescription, IResourceDescriptions) line: 16
ClusteringBuilderState.queueAffectedResources(Set<URI>, IResourceDescriptions, CurrentDescriptions, Collection<Delta>, Collection<Delta>, BuildData, IProgressMonitor) line: 534
ClusteringBuilderState.doUpdate(BuildData, ResourceDescriptionsData, IProgressMonitor) line: 306
ClusteringBuilderState(AbstractBuilderState).update(BuildData, IProgressMonitor) line: 115
XtextBuilder.doBuild(ToBeBuilt, IProgressMonitor, IXtextBuilderParticipant$BuildType) line: 242
XtextBuilder.incrementalBuild(IResourceDelta, IProgressMonitor) line: 222
XtextBuilder.build(int, Map, IProgressMonitor) line: 117
since i have no idea whats going on in your case why this is not happening i cannot give you futher hints
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.35128 seconds