Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Loading Eclipse plugins right from the Workspace(When the Project repo provides application specific Eclipse extensions)
Loading Eclipse plugins right from the Workspace [message #1857882] Fri, 03 March 2023 13:04 Go to next message
Michael Haubenwallner is currently offline Michael HaubenwallnerFriend
Messages: 4
Registered: March 2023
Junior Member
Dear Eclipse Oomph developers!

Right within our quite huge mono-repo application, we also maintain some Eclipse plugins, which are tightly coupled with the application code.
Besides some sophisticated Views and Editors, this also includes some Xtext DSLs with code generators, where the generated code has to match the application source code.
Some of these DSL content is interpreted not only within the running Eclipse at development time, but also within the application itself at runtime.
After all, "DomainSpecificLanguage" actually means "ApplicationSpecificLanguage" here, and there would be no point in maintaining their Eclipse plugins as separate projects.

Because of this tight coupling, we have a hard time distributing these Eclipse plugins in sync with the application source code - which is what I really would like to improve.
Note that we use Genuitec SDC as the Eclipse IDE distribution mechanism right now - without any sign of Oomph anywhere (yet?).

To start with, the overall idea now is to load the application specific Eclipse plugins right from the Workspace, where the Eclipse plugins' source code resides within the application's Git repo.

Consequently, upon some Git operation touching these Eclipse plugins' source code, the running Eclipse plugins should be reloaded as well.

What I have learned/accepted already:
- Despite propably supported by OSGi/Equinox, replacing running Eclipse plugins without restarting Eclipse is unlikely to work in a stable manner:
It should be acceptable to perform an Eclipse restart upon changes to Eclipse plugins found in the Workspace.
- Before restarting, automagically recompile Eclipse plugins after some Git operation is unlikely to work at all (different Target Platform, Project selection, etc.):
It should be acceptable to add ("ship") the binaries for those Eclipse plugins as part of the very same Git commit together with the code changes.

Thoughts so far?

What I have tried already:

For some very small Eclipse plugin project on Github, I have added this project's resulting p2 site to that very Git repo, in order to have some test situation for loading Eclipse plugins right from the Workspace.
Then, I have managed to create an Oomph Project Setup file, containing some P2 Director task loading that Eclipse plugins, with "Merge Disabled=true" to allow for disabling during early P2 tasks.
If curious, I can provide the weblink to that setup file for use with current Oomph-Installer - I'm just not allowed to add weblinks in my first forum post.

However, I haven't found yet how to declare that this one P2 Director task should run _after_ the Git Clone task or even after the Projects Import task has run.
Nevertheless, manually disabling this task during project setup, and manually "Perform Setup Tasks..." again afterwards does the trick here, to get the idea of what I'm after.

Anyway, this looks so promising already, even if I'm really new to Oomph!

However, migrating all our current SDC based setup to pure Oomph would be a lot of work.

Instead, to start with, my next idea was to engage the Oomph P2 Director Task only, in order to perform the Eclipse setup using Workspace content.

But then I failed to find the correct Oomph API to use.

For the moment, I have tried to use the org.eclipse.equinox.internal.p2.director.app.DirectorApplication instead right from within the running Eclipse:
While this seems to work - at least on Linux, I really would appreciate the additional features seen with Oomph P2 Director Task, like performing the Eclipse restart for example.

Whatever thoughts, they're welcome!

Thanks a lot!
Michael
Re: Loading Eclipse plugins right from the Workspace [message #1857883 is a reply to message #1857882] Fri, 03 March 2023 14:39 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33145
Registered: July 2009
Senior Member
Here's an approach that I've used. All my projects have Tycho builds that I can run locally as well as on Jenkins. When I install, I install from the update site that is created by Jenkins (and available via https on download.eclipse.org). I can do a local Tycho build to produce an update site from the changed contents in my workspace. Then I can use a redirection task to redirect the update site that I initially install from to the locally-built update site to install the latest version I have development, I can use Navigate -> Open Setup -> Workspace to add that setup task. In one of the projects (JustJ) I made the update site a variable with two choices, which defaults to use the Jenkins-built site but has a choice for the local-built repo (and I know exactly where in the git clone that repository is created); I can switch to this by doing Perform Setup Tasks... using <Back and Show all variables to change the choice later...

The general point is that if you build a p2 update site locally, you really don't need to do anything too fancy to be able to install from that update site. And I use this with both EMF and JustJ because each has tools that are generators that I might change and then want to use in the host development environment...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Loading Eclipse plugins right from the Workspace [message #1857885 is a reply to message #1857883] Fri, 03 March 2023 16:43 Go to previous messageGo to next message
Michael Haubenwallner is currently offline Michael HaubenwallnerFriend
Messages: 4
Registered: March 2023
Junior Member
Indeed, redirections should allow to avoid committing p2 repos to Git, thanks!

But still, I need to find the entry point to engage the "Oomph Workspace Setup Engine" from within another Eclipse plugin, which is not workspace specific, when neither Eclipse nor the Workspace were set up using Oomph - is this possible at all?

Or am I just too naive here?

Somehow I'm lost in the Oomph docs from a developer's point of view - I'm thinking of something like:
URI workspaceSetupURI = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getProject("setup").getFile("myworkspace.setup").getLocationURI();
new org.eclipse.oomph.TheWorkspaceSetupExecutor().execute(workspaceSetupURI);


Re: Loading Eclipse plugins right from the Workspace [message #1857892 is a reply to message #1857885] Sat, 04 March 2023 07:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33145
Registered: July 2009
Senior Member
Sorry, I'm really not sure what exactly you are trying to do. You could look at how org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(IWorkbench, IProgressMonitor) uses org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.create* where the latter is the "engine".

Normally to drive the engine you would try to use existing tasks and failing that would implement a task class that does what you want...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Loading Eclipse plugins right from the Workspace [message #1857932 is a reply to message #1857892] Tue, 07 March 2023 09:12 Go to previous message
Michael Haubenwallner is currently offline Michael HaubenwallnerFriend
Messages: 4
Registered: March 2023
Junior Member
Well, I'm still in the phase of learning about existing features, artifacts and workflows, to build an idea of whether and how they could help me to improve the situation here.

But still, thanks for the pointers, they for sure will help me learning!
Previous Topic:MacOS Secure Storage keychain Name change
Next Topic:Gitlab checkout Oomph template (InducedChoices)
Goto Forum:
  


Current Time: Tue May 07 14:08:31 GMT 2024

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

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

Back to the top