Skip to main content



      Home
Home » Eclipse Projects » Oomph » Execute org.eclipse.core.commands in oomph task(Ability to execute existing commands in the target installation)
Execute org.eclipse.core.commands in oomph task [message #1803866] Tue, 12 March 2019 12:19 Go to next message
Eclipse UserFriend
Hello,

currently i am creating an oomph setup for a project, which needs OS specific settings. Manually the user has to trigger the command execution by selecting the corresponding menu.

Is it possible to specify command execution or what is the correct way to execute "java code" or org.eclipse.core.commands within an oomph setup task?

Thank you in advance.

Best regards
M. Karaman
Re: Execute org.eclipse.core.commands in oomph task [message #1803881 is a reply to message #1803866] Wed, 13 March 2019 01:09 Go to previous messageGo to next message
Eclipse UserFriend
There is currently no existing task implementation that would directly provide support for invoking a command (or arbitrary Java code). You'd need to implement a specialized SetupTask for that, and then minimally implement the two abstract isNeeded and perform methods. Is that your intent?

What specifically do these commands need to do? After all, there are tasks such as the Resource Creation, Resource Copy, and Text Modify that allow you to change arbitrary files on disk...
Re: Execute org.eclipse.core.commands in oomph task [message #1803887 is a reply to message #1803881] Wed, 13 March 2019 04:23 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for your reply. The above mentioned command is creating an external tool launch configuration file for the selected project. For this i need to find the ng executable in the OS specific path from its environemnt variable PATH. So Text Modify would maybe help, if i could add the NG (or NPM for another case) executables paths.

The example external tool launch config file looks like that on Mac:
Quote:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="PATH" value="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:"/>
</mapAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/usr/local/lib/node_modules/@angular/cli/bin/ng"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="serve --open"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/PromoJSFlow}"/>
</launchConfiguration>


org.eclipse.ui.externaltools.ATTR_LOCATION and PATH mapEntry is OS Specific.

[Updated on: Wed, 13 March 2019 04:31] by Moderator

Re: Execute org.eclipse.core.commands in oomph task [message #1803894 is a reply to message #1803887] Wed, 13 March 2019 06:28 Go to previous messageGo to next message
Eclipse UserFriend
Perhaps you'd be best to define and contribute your own dynamic variables that are used by the launch configuration. E.g., using the org.eclipse.core.variables.dynamicVariables extension point. We use that for some things in Oomph as well:

https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.targlets.core/plugin.xml#n52

Then you could include the specific launch configurations themselves in the projects' source so that they are available automatically as well as install your extension point implementation into the Eclipse installation so that any launch configurations could make use of them. This way, OS-specific things are not needed directly in the launch configurations but rather are handled by the variable resolver.
Re: Execute org.eclipse.core.commands in oomph task [message #1803905 is a reply to message #1803894] Wed, 13 March 2019 08:01 Go to previous message
Eclipse UserFriend
Note there is also StringSubstitutionTask which you could define with a OS-based filter

https://wiki.eclipse.org/Eclipse_Oomph_Authoring#Conditional_Tasks

so that the value is different for each OS, and then use those variables in the configuration.
Previous Topic:Generating PDE Target Definition files for a targlet located in the workspace
Next Topic:Eclipse installer 2018-12 stops with error
Goto Forum:
  


Current Time: Wed Jul 23 02:23:22 EDT 2025

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

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

Back to the top