Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Calling Xtend generation from my Builder Participant(Xtext 2.0)
Calling Xtend generation from my Builder Participant [message #734376] Fri, 07 October 2011 15:00 Go to next message
Lucy Sakhnenko is currently offline Lucy SakhnenkoFriend
Messages: 41
Registered: March 2011
Member
Hi,

I would like to start doing some of the code generation of my project with Xtend. I already have a Builder Participant registered, which xtends from JavaProjectBasedBuilderParticipant and implements IXtextBuilderParticipant.

If I combine my builder participant and the automatic xtext code generation, I get:

java.lang.NullPointerException
	at org.eclipse.xtext.builder.JavaProjectBasedBuilderParticipant.getConfiguredFileSystemAccess(JavaProjectBasedBuilderParticipant.java:112)
	at org.eclipse.xtext.builder.JavaProjectBasedBuilderParticipant.build(JavaProjectBasedBuilderParticipant.java:77)
	at altagracia.builder.XtextMyDSLBuilderParticipant.build(XtextMyDSLBuilderParticipant.java:41)
	at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:60)
	at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:160)
	at org.eclipse.xtext.builder.impl.XtextBuilder.fullBuild(XtextBuilder.java:182)
	at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:85)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)



I think I should somehow call the xtend generation from MyDSLBuilderParticipant.

My DSL projects don't need to have Java nature, and this exception appears when I add the java nature to my project (I think it registers two java builder participants).

I'm lost here, I would appreciate any advice.

Thanls!

Re: Calling Xtend generation from my Builder Participant [message #734377 is a reply to message #734376] Fri, 07 October 2011 15:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

make sure you use the YourdslExecutableExtensionFactory in your plugin.xml (when registering the builerparticipant.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 07 October 2011 15:08]

Report message to a moderator

Re: Calling Xtend generation from my Builder Participant [message #734380 is a reply to message #734377] Fri, 07 October 2011 15:13 Go to previous messageGo to next message
Lucy Sakhnenko is currently offline Lucy SakhnenkoFriend
Messages: 41
Registered: March 2011
Member
Hi, Christian.

I don't understand. My Xtext project works well and generates code alone. Its plugin.xml of the .ui project has the ExecutableExtensionFactory in it.

Now, I have another project with the builder participant which receives Xtext resources and generates code using Jet.

The exception is thrown when I have this "another project" and the xtext projects (doing the xtend generation) all opened.

Do you mean I have to register my ExecutableExtensionFactory in this other non-xtext project?
Re: Calling Xtend generation from my Builder Participant [message #734385 is a reply to message #734376] Fri, 07 October 2011 15:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi as i said. You get the NPE cause you do not use guice to create
the Builder participant. This is usually done with the
ExecuableExtensionFactory. You may have to create a own for your
plugin. Regards Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 07 October 2011 15:52]

Report message to a moderator

Re: Calling Xtend generation from my Builder Participant [message #734393 is a reply to message #734385] Fri, 07 October 2011 16:00 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

maybe you can use this http://kthoms.wordpress.com/2011/09/28/moving-an-xtend-generator-into-its-own-plugin/
as a starting point.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:About Xtext and GMF intergration
Next Topic:My first XText
Goto Forum:
  


Current Time: Thu Apr 25 00:02:29 GMT 2024

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

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

Back to the top