Re: Module suite distribution and/or per-service activation tokens

Emilian Bold <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAL6R17B2v=pR0DAa+h678DuhW87Ss5Ln4-dC-_GV1O9-ZyXusw@mail.gmail.com>
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
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.