Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » launching mwe2 during the setup
launching mwe2 during the setup [message #1700845] Tue, 07 July 2015 14:39 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I'd like to come back to the problems running mwe2 workflows during the
setup (of course, the main scenario is Xtext languages :)

this issue has already been discussed a bit:
https://www.eclipse.org/forums/index.php/t/806515/ (in particular the
java.lang.NoClassDefFoundError:
org/eclipse/emf/mwe2/launch/runtime/Mwe2Launcher problem).

I managed to run an mwe2 launch task during the setup for a few of my
Xtext projects (e.g.,
https://github.com/LorenzoBettini/xtraitj/blob/master/xtraitj.oomph/Xtraitj.setup)

the trick seems to be to run the same mwe2 launch twice.

In fact, mwe2 launch configurations by default are setup to refresh the
workspace, and the second time, there's no problem :) (while on the
first run you get java.lang.NoClassDefFoundError:
org/eclipse/emf/mwe2/launch/runtime/Mwe2Launcher).

I guess this happens because when you refresh the workspace, then PDE
gets to know about required plugins and so the Mwe2Launcher class is
found. (Of course this assumes that the launch is performed after the
targlet task).

For the above reasons, I guess that a task that simply refreshes the
workspace would be really helpful in such situations. IIRC refreshing
the workspace programmatically is just a matter of a few lines. Do you
think it would be feasible/useful to add it to Oomph?

Another thing that I would find useful is a task that builds the
workspace (again, doing this programmatically should be easy): I'm
thinking about a situation where the mwe2 workflow uses some custom
generator fragments that are in another project (of the same codebase
which is being imported in the workspace), and thus that project should
be built first.

Do you think these could be sensible enhancements?

cheers
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


Re: launching mwe2 during the setup [message #1700866 is a reply to message #1700845] Tue, 07 July 2015 17:53 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 07.07.2015 um 16:39 schrieb Lorenzo Bettini:
> Hi
>
> I'd like to come back to the problems running mwe2 workflows during the
> setup (of course, the main scenario is Xtext languages :)
>
> this issue has already been discussed a bit:
> https://www.eclipse.org/forums/index.php/t/806515/ (in particular the
> java.lang.NoClassDefFoundError:
> org/eclipse/emf/mwe2/launch/runtime/Mwe2Launcher problem).
>
> I managed to run an mwe2 launch task during the setup for a few of my
> Xtext projects (e.g.,
> https://github.com/LorenzoBettini/xtraitj/blob/master/xtraitj.oomph/Xtraitj.setup)
>
> the trick seems to be to run the same mwe2 launch twice.
>
> In fact, mwe2 launch configurations by default are setup to refresh the
> workspace, and the second time, there's no problem :) (while on the
> first run you get java.lang.NoClassDefFoundError:
> org/eclipse/emf/mwe2/launch/runtime/Mwe2Launcher).
>
> I guess this happens because when you refresh the workspace, then PDE
> gets to know about required plugins and so the Mwe2Launcher class is
> found. (Of course this assumes that the launch is performed after the
> targlet task).
>
> For the above reasons, I guess that a task that simply refreshes the
> workspace would be really helpful in such situations. IIRC refreshing
> the workspace programmatically is just a matter of a few lines. Do you
> think it would be feasible/useful to add it to Oomph?
>
> Another thing that I would find useful is a task that builds the
> workspace (again, doing this programmatically should be easy): I'm
> thinking about a situation where the mwe2 workflow uses some custom
> generator fragments that are in another project (of the same codebase
> which is being imported in the workspace), and thus that project should
> be built first.
>
> Do you think these could be sensible enhancements?
Yes, that makes sense to me. Please go ahead and submit bugzillas.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: launching mwe2 during the setup [message #1700939 is a reply to message #1700866] Wed, 08 July 2015 10:28 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=472158

thanks in advance
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


Re: launching mwe2 during the setup [message #1701343 is a reply to message #1700939] Sun, 12 July 2015 09:05 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
An issue that bugs me with running the workflow during setup is that I'd want it to run only on the very first startup. Once the language is built and the project compiles, it is the developer's responsibility to rerun the workflow after grammar(/workflow) changes. I do not want to build the language on every Eclipse startup.

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: launching mwe2 during the setup [message #1701357 is a reply to message #1701343] Sun, 12 July 2015 14:25 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Alexander,

Yes that's understandable, and that should already work.

public boolean isNeeded(SetupTaskContext context) throws Exception
{
String launcher = getLauncher();
Trigger trigger = context.getTrigger();
if (trigger == Trigger.STARTUP)
{
// If we've performed this task at least once, don't do it
automatically again.
String property = HISTORY.getProperty(launcher, null);
if (property != null)
{
return false;
}
}

return true;
}

On 12/07/2015 11:05 AM, Alexander Nittka wrote:
> An issue that bugs me with running the workflow during setup is that
> I'd want it to run only on the very first startup. Once the language
> is built and the project compiles, it is the developer's
> responsibility to rerun the workflow after grammar(/workflow) changes.
> I do not want to build the language on every Eclipse startup.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Fail to contact HTTPS/SSL p2 repositories
Next Topic:Setup centralized setup environment
Goto Forum:
  


Current Time: Sat Apr 27 02:58:13 GMT 2024

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

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

Back to the top