eclipseosgiosgi-bundle

Why does my Eclipse launch config ignore my plug-in's environment specification?


In my big project, I have an Eclipse Application launch config. It launches the application based on selected features (features being groups of plug-ins).

In one of these features, there is a plug-in which is specified to only be installed if it is launched in a Linux environment. This is what that looks like in the feature.xml file:

<plugin
    id="com.company.package.cool.plugin"
    os="linux"
    ws="gtk"
    arch="x86_64"
    download-size="0"
    install-size="0"
    version="0.0.0"
    unpack="false"/>

And yet, Eclipse installs the plug-in when the application is launched in a Windows environment.

Why does Eclipse ignore its own specification? Is there a fix? Is there a workaround?


Solution

  • The Eclipse-PlatformFilter in the plug-in's MANIFEST.MF controls when the plug-in is "resolved". Convert your plug-in to a fragment an add this line (macOS only example):

    Eclipse-PlatformFilter: (& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=x86_64) )
    

    I'm not absolutely sure but I think the feature.xml specification is only used by installers.

    More info can be found on vogel/a