Yeah, but I still have to differentiate myself between OSX and Linux.

A module suite with per-OS modules (so, OpenIDE-Module-Requires:
org.openide.modules.os.MacOSX and OpenIDE-Module-Requires:
org.openide.modules.os.Linux) is perfect.

But it is hard to distribute.

What would be interesting would be

@ServiceProvider(requires=org.openide.modules.os.Linux)

;-)

Of course, I assume the token is basically the same as an Utilities.isMac()
check.

Checking manually would work if I would have a factory service. Then I
could conditionally return null inside the factory if the token / Utilities
check don't match the OS.



--emi

On Thu, Dec 8, 2016 at 5:47 PM, Jaroslav Tulach <[email protected]>
wrote:

> On čtvrtek 8. prosince 2016 14:41:01 CET Emilian Bold wrote:
> > Hello,
> >
> > I have this plugin (http://nbnotify.com ) that works only on macOS so
> it has
> >
> > OpenIDE-Module-Requires: org.openide.modules.os.MacOSX
> >
> > I want to extends this plugin to work on Linux too.
> >
> > Now, one solution would be to create a 2nd module with something like
> >
> > OpenIDE-Module-Requires: org.openide.modules.os.Linux
> >
> > But then I need to distribute 2 modules.
> >
> > It would be ideal to be able to distribute a suite in the Plugin Portal
> so
> > I could bundle both modules. As far as I know this is not possible,
> > correct? (This is annoying since I cannot reuse code between the two
> > modules).
>
> There is:
> OpenIDE-Module-Requires: org.openide.modules.os.Unix
> which might work for you relatively well.
>
> -jt
>
> >
> > Alternatively it would be nice to conditionally register services based
> on
> > a token. Then I could have a single module which bundles the both
> operating
> > system services.
> >
> > Are there other solutions I'm not aware of?
> >
> > PS: Crossposting to [email protected] because we have to
> > start using it for Platform questions.
> >
> > --emi
>
>
>

Reply via email to