Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » TargetDefinitionGenerator with platform-specific dependencies
TargetDefinitionGenerator with platform-specific dependencies [message #1759201] Fri, 07 April 2017 15:38 Go to next message
Luca Beurer-Kellner is currently offline Luca Beurer-KellnerFriend
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 #1759206 is a reply to message #1759201] Fri, 07 April 2017 14:16 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29538
Registered: July 2009
Senior Member
Have you tried setting "Include All Platform" to true on the Targlet? That's what we do with Oomph's own targlets, because we want the target platform to include fragments for all platforms, not just for Windows, because otherwise we have way too many warnings about missing dependencies. That should help address 1. and probably also 2. because the dependencies for all the platforms will be resolves and so the additional update site should be used and end up in the *.target file.
Re: TargetDefinitionGenerator with platform-specific dependencies [message #1760062 is a reply to message #1759201] Fri, 21 April 2017 15:08 Go to previous messageGo to next message
Luca Beurer-Kellner is currently offline Luca Beurer-KellnerFriend
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 #1760087 is a reply to message #1760062] Sat, 22 April 2017 06:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29538
Registered: July 2009
Senior Member
Looking at https://github.com/turesheim/eclipse-launcher/blob/master/net.resheim.eclipse.launcher-feature/feature.xml it seems the entire feature is Mac-only
<feature
      id="net.resheim.eclipse.launcher"
      label="%featureName"
      version="3.0.0.qualifier"
      provider-name="%providerName"
      plugin="net.resheim.eclipse.launcher.core"
      os="macosx"
      ws="cocoa"
arch="x86_64">
so I don't think you should be trying to contain the plugins directly. The annotation is processed like this:
  private static Set<IVersionedId> getExtraUnits(Annotation annotation)
  {
    Set<IVersionedId> extraUnits = new HashSet<IVersionedId>();

    String values = annotation.getDetails().get(ANNOTATION_EXTRA_UNITS);
    if (!StringUtil.isEmpty(values))
    {
      for (String value : values.replace(',', ' ').split(" "))
      {
        if (!StringUtil.isEmpty(value))
        {
          int pos = value.lastIndexOf('_');
          String id = pos == -1 ? value : value.substring(0, pos);
          Version version = pos == -1 ? Version.emptyVersion : Version.create(value.substring(pos + 1));
          extraUnits.add(new VersionedId(id, version));
        }
      }
    }

    return extraUnits;
  }
so spaces or commas can be used to separate multiple units.

In the end, unless I can reproduce a problem, it's hard to comment on why it happens and whether that's a bug or not.
Re: TargetDefinitionGenerator with platform-specific dependencies [message #1760566 is a reply to message #1760087] Fri, 28 April 2017 12:08 Go to previous messageGo to next message
Luca Beurer-Kellner is currently offline Luca Beurer-KellnerFriend
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

Re: TargetDefinitionGenerator with platform-specific dependencies [message #1760575 is a reply to message #1760566] Fri, 28 April 2017 14:26 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29538
Registered: July 2009
Senior Member
I really appreciate that you created a test case! Unfortunately I'm all tied up with other work right now, so let's assume there is a bug and please open a Bugzilla with these details. Then the problem won't completely fall off the radar map.
Previous Topic:Disable mirror setting automatically
Next Topic:Oomph Installation folder name
Goto Forum:
  


Current Time: Wed Sep 19 16:54:38 GMT 2018

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

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

Back to the top