TargetDefinitionGenerator with platform-specific dependencies [message #1759201] |
Fri, 07 April 2017 15:38 |
Luca Beurer-Kellner Messages: 3 Registered: April 2017 |
Junior Member |
|
|
Hi everyone,
we are using Oomph to setup up our developer IDE and we're also using Oomph targlets to generate the target platform for our IDE product. This product has a plugin dependency that only works with MacOS , therefore we only want to include it in the Mac version of the product.
I specified the p2 repository of the plugin in the targlet part of our setup and also declared an operating-system-dependent feature dependency for our product. When performing the setup on MacOS everything works as intended. However, when performing the setup on a non-MacOS (in my case, Windows) machine, Oomph doesn't include the p2 repository of this plugin in the generated target definition.
This makes sense so far, as the dependency doesn't exit on that platform, which makes the corresponding repository obsolete. However, it leaves me with two problems:
1. The developer IDE will report a validation warning for the operating-system-dependent plugin dependency, as the feature identifier can't be resolved. (because of the missing p2 repository in the active target platform)
2. The generated target definition file (.target) will always show up as a change in git, as this file is checked in in our VCS. We do this, so that maven can pick up the target definition when running on the build servers.
It would be interesting to hear, if anybody else has experienced a similar situation or if there is a proper way to deal with that situation.
Kind regards
Luca Beurer-Kellner
|
|
|
|
Re: TargetDefinitionGenerator with platform-specific dependencies [message #1760062 is a reply to message #1759201] |
Fri, 21 April 2017 15:08 |
Luca Beurer-Kellner Messages: 3 Registered: April 2017 |
Junior Member |
|
|
Hello Ed,
thank you for your response. Sorry for the delay, I haven't been at work for a little while.
As you suggested, I enabled includeAllPlatforms. However, this still doesn't resolve the issue.
I am trying to integrate the OS X eclipse launcher: https://github.com/turesheim/eclipse-launcher.
Previously I included the launcher feature, which resulted in the mentioned situation.
To experiment, I tried to directly integrate the two contained plugins. In my feature.xml I added them like so:
<plugin
id="net.resheim.eclipse.launcher.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="net.resheim.eclipse.launcher.macosx"
os="macosx"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
As you can see, only the second plugin is declared platform-dependent. When running the Setup Task on a Windows machine, this dependency results in the following target definition entry:
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="net.resheim.eclipse.launcher.core" version="3.0.0.201509271854"/>
<repository location="https://resheim.net/p2/eclipse-launcher/"/>
</location>
On a Mac machine however, the following target definition entry is generated:
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="net.resheim.eclipse.launcher.macosx" version="3.0.0.201509271854"/>
<repository location="https://resheim.net/p2/eclipse-launcher/"/>
</location>
After experimenting a bit, I could use the extraUnits detail of the TargetDefinitionGenerator to make the ".macosx" variant appear at that point, even on a Windows machine.
<detail
key="extraUnits">
<value>net.resheim.eclipse.launcher.macosx</value>
</detail>
However, I am quite unsure about this approach, as I couldn't find any documentation about this extraUnits detail.
Also, I can't really see, how to specify multiple "extra units". Unfortunately our existing configuration already defines an extraUnits value and, if possible, both should be specified.
After all, isn't the includeAllPlatforms option supposed to take care of this anyway?
I am looking forward to hear from you and to learn how this works.
Luca
|
|
|
|
Re: TargetDefinitionGenerator with platform-specific dependencies [message #1760566 is a reply to message #1760087] |
Fri, 28 April 2017 12:08 |
Luca Beurer-Kellner Messages: 3 Registered: April 2017 |
Junior Member |
|
|
Hello Ed,
thank you for your response.
The snippets that you've provided were really helpful. I could use the extraUnits detail to achieve my intended behaviour.
However, to my understanding my use case should be covered by the includeAllPlatforms parameter. Thus, I tried to create a test project to reproduce the bug.
I created a simple setup here https://raw.githubusercontent.com/lbeurerkellner/oomph-cross-platform/master/bugreport.setup , which will create a workspace for this project https://github.com/lbeurerkellner/oomph-cross-platform . (I created it using the Eclipse IDE for Committers product) As described, the project requires the OS X Eclipse Launcher but only on macOS.
If I run this setup on a windows machine the generated target file (bugreport.project/TP.target) doesn't contain the Eclipse Launcher update site:
<?xml version="1.0" encoding="Cp1252" standalone="no"?>
<?pde version="3.8"?>
<target name="Generated TP" sequenceNumber="1">
<locations>
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.300.v20161122-1740"/>
<repository location="http://download.eclipse.org/eclipse/updates/4.6/R-4.6.2-201611241400"/>
</location>
</locations>
</target>
On a mac machine it looks fine:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="Generated TP" sequenceNumber="1">
<locations>
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.300.v20161122-1740"/>
<unit id="org.eclipse.ui.ide" version="3.12.2.v20161115-1450"/>
<repository location="http://download.eclipse.org/eclipse/updates/4.6/R-4.6.2-201611241400"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="net.resheim.eclipse.launcher.feature.group" version="3.0.0.201509271854"/>
<repository location="https://resheim.net/p2/eclipse-launcher/"/>
</location>
</locations>
</target>
And this happens despite the enabled includeAllPlatforms parameter.
Is it possible that I don't understand the feature correctly or could this be a bug?
Thanks a lot!
Luca
[Updated on: Fri, 28 April 2017 12:14] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02936 seconds