0

I am currently developing plug-ins for an eclipse RCP application. One of the plug-ins needs OS-specific implementations.

It seems that plugin fragments would meet my needs (see e.g. 1, 2, 3).

I think I understand how fragments work now, but apart from the sparse documentation of fragments, there doesn't seem to be any documentation of the Eclipse-PlatformFilter header in the manifest file.

According to 4, it has to be a valid LDAP filter string, but that doesn't explain any more than the two examples I found on the internet (the MacOS cocoa one and the windows 32bit one).

So my question is:

Is there any documentation of the Eclipse-PlatformFilter header?

(If there isn't, can anybody tell me the valid values for the header?)

danzel
  • 270
  • 1
  • 7

1 Answers1

4

The following is an example of the Eclipse-PlatformFilter header:

Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86))

Here are possible values for each osqi.* property

Operating system - osgi.os: win32, linux, macosx, aix, solaris, hpux, qnx

Windowing system - osgi.ws: win32, motif, gtk, photon, cocoa

Processor architecture osgi.arch: x86, x86_64, ia64, ia64_32, ppc, PA_RISC, sparc

Example above would activate fragment only when Eclipse is running on Windows 32bit.

If you want to activate when running on Windows 64bit you would use:

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

on linux 32bit

Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))

on linux 64bit

Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86_64))

on macOS 64bit and PowerPC

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

You can pick at eclipse fragments to figure out filers for all supported platforms.

dgolovin
  • 1,412
  • 11
  • 23
  • Thank you very much, that helps a lot. Is it possible to specify multiple values, e.g. x86 and x86_64? I'm still curious where these values come from, though (LDAP, Java, Eclipse,...). BTW, there is only a text field for specifying the platform filter in the fragment's `MANIFEST.MF` (latest eclipse photon for eclipse committers), that's why I asked for the possible values. – danzel Oct 26 '18 at 08:06
  • 1
    @danzel The LDAP syntax allows an 'or' operator using `|` - one I found is `(& (osgi.ws=cocoa) (osgi.os=macosx) (|(osgi.arch=x86)(osgi.arch=ppc)) )` - Cocoa on macOS with either x86 or ppc architectue. – greg-449 Oct 27 '18 at 09:32