How to share configuration data between two independent plugins

hello

How can I share configuration data between two plugins A and B that otherwise do not depend on each other. The configuration data should be accessible if one has installed A only, B only, or both A and B. I guess that rules out registering an JDOMExternalizable application component..?

Any ideas are highly appreciated! Thanks.

etienne

0

I had exactly the same problem. Here is my solution, I'm not sure is it is
the best.
Following your example I added a third plugin called C.
In A & B plugin.xml I added the following dependency:

C Regards Boaz In plugin C i put the shared data simply be registering an JDOMExternalizable application component. This solution is also good for sharing code. "etienne" ]]> wrote in message
news:29919871.1164816978453.JavaMail.itn@is.intellij.net...

hello

>

How can I share configuration data between two plugins A and B that
otherwise do not depend on each other. The configuration data should be
accessible if one has installed A only, B only, or both A and B. I guess
that rules out registering an JDOMExternalizable application component..?

>

Any ideas are highly appreciated! Thanks.

>

etienne



0

Interesting. Thanks for your thoughts.

etienne

0

Answering myself here...

The way I now share the configuration between two plugins is by reading/writing my own xml config file in the user's IDEA options folder.

String optionsPath = PathManager.getOptionsPath();
String filePath = optionsPath + File.separator + "myConfig.xml";

Concurrent access is not an issue, in my specific case.

etienne

0

请先登录再写评论。