Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to create a builder without ui
How to create a builder without ui [message #641513] Thu, 25 November 2010 18:46 Go to next message
Patrick Ruckstuhl is currently offline Patrick RuckstuhlFriend
Messages: 65
Registered: July 2009
Member
Currently we have the standard setup with the dsl, generator and ui projects. In the ui project we have a builder participant. We now would like to use this builder in the headless (buckminster) build as well.

If add the ui project to buckminster I get lots of errors when trying to do a build. It looks the same issue as here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=310848

I've seen that the BuilderParticipant interface is not in the ui namespace so I'm wondering if I can create a different plugin, that just has the builder participant in it.

I tried to do this and created a new plugin with an activator that looks like this

public class MessageDslBuilderActivator extends Plugin {
	private static MessageDslBuilderActivator INSTANCE;
	
	@Override
	public void start(BundleContext context) throws Exception {
		super.start(context);
		INSTANCE = this;
	}
	
	public static MessageDslBuilderActivator getInstance() {
		return INSTANCE;
	}
	
}


In this context, now the builder gets called when doing a save on a file but the delta is empty.

Do I need to setup an guice injector somehow or is there something else I'm missing?

Is it possible to have something like this:


In buckminster:
-messagedsl
-builder

In eclipse:
-messagedsl
-builder
-ui

So basically I'd like to have the builder be available headless and the ui plugin should only contain the real ui stuff.

Thanks,
Patrick
Re: How to create a builder without ui [message #666723 is a reply to message #641513] Thu, 21 April 2011 23:47 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
I was interested in doing the same, but there is no "pure" headless
builder in Xtext as there are dependencies on other ui related things in
the required bundle(s). I would love to see an Xtext package that is
headless (that only depend on the headless workspace and resource parts
of eclipse).

I spent some time investigating this, and it looks like it is basically
a repackaging exercise.

Having the builders and workspace containers available in a headless
package would make it a lot easier to write a single implementation for
building that works both in the UI and for CI/headless.

Regards
- henrik

On 11/25/10 7:46 PM, Patrick Ruckstuhl wrote:
> Currently we have the standard setup with the dsl, generator and ui
> projects. In the ui project we have a builder participant. We now would
> like to use this builder in the headless (buckminster) build as well.
>
> If add the ui project to buckminster I get lots of errors when trying to
> do a build. It looks the same issue as here:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=310848
>
> I've seen that the BuilderParticipant interface is not in the ui
> namespace so I'm wondering if I can create a different plugin, that just
> has the builder participant in it.
>
> I tried to do this and created a new plugin with an activator that looks
> like this
>
>
> public class MessageDslBuilderActivator extends Plugin {
> private static MessageDslBuilderActivator INSTANCE;
>
> @Override
> public void start(BundleContext context) throws Exception {
> super.start(context);
> INSTANCE = this;
> }
>
> public static MessageDslBuilderActivator getInstance() {
> return INSTANCE;
> }
>
> }
>
>
> In this context, now the builder gets called when doing a save on a file
> but the delta is empty.
>
> Do I need to setup an guice injector somehow or is there something else
> I'm missing?
>
> Is it possible to have something like this:
>
>
> In buckminster:
> -messagedsl
> -builder
>
> In eclipse:
> -messagedsl
> -builder
> -ui
>
> So basically I'd like to have the builder be available headless and the
> ui plugin should only contain the real ui stuff.
>
> Thanks,
> Patrick
Re: How to create a builder without ui [message #666864 is a reply to message #666723] Sat, 23 April 2011 15:04 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 4/22/11 1:47 AM, Henrik Lindberg wrote:
> I was interested in doing the same, but there is no "pure" headless
> builder in Xtext as there are dependencies on other ui related things in
> the required bundle(s). I would love to see an Xtext package that is
> headless (that only depend on the headless workspace and resource parts
> of eclipse).
>
> I spent some time investigating this, and it looks like it is basically
> a repackaging exercise.
>
> Having the builders and workspace containers available in a headless
> package would make it a lot easier to write a single implementation for
> building that works both in the UI and for CI/headless.
>
I think I spoke too soon - turns out that the dependencies on ui are
optional, so it should work to use org.eclipse.xtext.builder in headless
fashion (given that the builder participants themselves are not in
packages that require ui).

Regards
- henrik
Previous Topic:INCLUDE <file>
Next Topic:xtend2 boolean switch
Goto Forum:
  


Current Time: Thu Apr 25 04:23:29 GMT 2024

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

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

Back to the top