Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Is there a way to make the launch task wait
Is there a way to make the launch task wait [message #1417428] Fri, 05 September 2014 12:04 Go to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

I want to provide a setup for an Xtext project. The generated code is not checked into the git repository. What I managed so far is cloning the repository, populating the workspace and having a manual Launcher Task that executes the workflow generating the Xtext artefacts.

However, there is no advantage of a manual task over running the mwe2 workflow using a launch config.

I was not able to run the Launcher Task in the startup phase successfully. I get a 'Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/mwe2/launch/runtime/Mwe2Launcher', presumably because the workspace is not yet built properly at that point.

Is there a way to make a task wait for the workspace to be built, or do you have another idea (checking in generated code is not an option at the moment?

The setup is available at https://github.com/AKSW/Xturtle/blob/master/xturtleDev.setup
(in case you try out the setup, chose the develop branch - more cleanup is needed before both branches are properly oomphed)

Thanks for any hints.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de

[Updated on: Fri, 05 September 2014 12:15]

Report message to a moderator

Re: Is there a way to make the launch task wait [message #1417454 is a reply to message #1417428] Fri, 05 September 2014 13:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
Alexander,

Comments below.

On 05/09/2014 2:04 PM, Alexander Nittka wrote:
> Hi,
>
> I want to provide a setup for an Xtext project. The generated code is
> not checked into the git repository. What I managed so far is cloning
> the repository, populating the workspace and having a manual Launcher
> Task that executes the workflow generating the Xtext artefacts.
So this is the stuff for generating code from the grammar, right?
>
> However, there is no advantage of a manual task over running the mwe2
> workflow using a launch config.
>
> I was not able to run the Launcher Task in the startup phase
> successfully. I get a 'Exception in thread "main"
> java.lang.NoClassDefFoundError:
> org/eclipse/emf/mwe2/launch/runtime/Mwe2Launcher', presumably because
> the workspace is not yet built properly at that point.
If it's for the grammar, it's probably more an issue of the PDE not
having fully updated its knowledge of all the things in the Target
Platform. I'm not sure when that happens but I think it is a build step
and of course during provisioning for the workspace and target platform,
the build is disabled. Perhaps there's some method we can call to force
that to happen right after we activate the induced target platform, but
without having investigated, I can't be sure. Of course in general, a
launcher might really need things to be fully built, and such a thing
would definitely need to happen after or as part of a build...
>
> Is there a way to make a task wait for the workspace to be built, or
> do you have another idea (checking in generated code is not an option
> at the moment?
No, I don't have any good ideas. I do have the nagging feeling that
things like this should really be driven by something like an Ant task
that's properly integrated with the builds, but I could investigate how
this might work for Xcore's grammar (assuming this is a grammar
generation issue). Please open a bugzilla describing the problem and
hopefully I'll find time soon to investigate...
>
> The setup is available at
> https://github.com/AKSW/Xturtle/blob/master/xturtleDev.setup
>
> Thanks for any hints.
>
> Alex


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Is there a way to make the launch task wait [message #1417475 is a reply to message #1417454] Fri, 05 September 2014 14:16 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Thanks for the quick response. (Yes I was talking about code generated from the grammar)
I guess, even if the launch task worked on startup, more "problems" were ahead. You don't want to run the generator on every startup (or even on every manual setup task), but only when changes were made to the grammar.
The ideal solution would be a "run only on first populating the workspace", possibly a setup that sets up the workspace and then redirects itself to a stripped down version, not containing the Launch-Task (or another "first-build" equivalent) anymore.

At a customer, we have Maven based projects with Xtext models and when doing a Maven-Import a build is triggered that generates the code. I imagine something similar could be done within an Oomph-setup. Git clone, maven import and then targlet definition?

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Is there a way to make the launch task wait [message #1417495 is a reply to message #1417475] Fri, 05 September 2014 15:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
Alex,

Comments below.

On 05/09/2014 4:16 PM, Alexander Nittka wrote:
> Thanks for the quick response. (Yes I was talking about code generated
> from the grammar) I guess, even if the launch task worked on startup,
> more "problems" were ahead. You don't want to run the generator on
> every startup (or even on every manual setup task), but only when
> changes were made to the grammar.
Yes, knowing whether a task is needed or not is another concern.
> The ideal solution would be a "run only on first populating the
> workspace", possibly a setup that sets up the workspace and then
> redirects itself to a stripped down version, not containing the
> Launch-Task (or another "first-build" equivalent) anymore.
Yes, or include some type of predicates (like for the dynamic working
sets) that let you specify the condition for it being triggered...
>
> At a customer, we have Maven based projects with Xtext models and when
> doing a Maven-Import a build is triggered that generates the code.
Can the generation be triggered by an Ant task? That would seem the
better overall design so that a clean build, cleans it, and full build
regenerates it, and so on...
> I imagine something similar could be done within an Oomph-setup. Git
> clone, maven import and then targlet definition?
Yes, though as I mention, I am very hesitant to delve into the build
space. There is a great deal of technology there in that space, and
Oomph is not currently aiming to be part of the build process, but
rather for setting everything up that needs to be available for the
build process...
>
> Alex


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Is there a way to make the launch task wait [message #1696993 is a reply to message #1417475] Sat, 30 May 2015 11:59 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1813
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 05/09/2014 16:16, Alexander Nittka wrote:
> At a customer, we have Maven based projects with Xtext models and when
> doing a Maven-Import a build is triggered that generates the code. I
> imagine something similar could be done within an Oomph-setup. Git
> clone, maven import and then targlet definition?

Hi

can you please share some details on how this is achieved?

thanks
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:proper value for "Logical Project Container" for internal projects
Next Topic:Set Launcher History in Oomph Setup
Goto Forum:
  


Current Time: Tue Sep 24 00:57:52 GMT 2024

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

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

Back to the top