launching mwe2 during the setup [message #1700845] |
Tue, 07 July 2015 14:39 |
|
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
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Re: launching mwe2 during the setup [message #1700866 is a reply to message #1700845] |
Tue, 07 July 2015 17:53 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
Re: launching mwe2 during the setup [message #1701357 is a reply to message #1701343] |
Sun, 12 July 2015 14:25 |
Ed Merks Messages: 33258 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/
|
|
|
Powered by
FUDForum. Page generated in 0.02217 seconds