Plugins with their own plugins??

I have redesigned my CVSRevisionGraph plugin to be generic for any Vcs implementation. I called it VcsRevisionGraph. Right now, I have added support for both CVS and Subversion. Therefore, I made the new VcsRevisionGraph be dependent on the CVS and Subversion plugins that ship with IntelliJ.

The problem is that if a user has disabled the Subversion plugin (via the Plugin Manager dialog), my plugin will not load because it is dependent on both CVS and Subversion. I thought if I just remove the dependencies in my plugin.xml, then everything would be OK. That didn't work. My plugin has two actions, one for CVS and one for Subversion. These actions are loaded on IntelliJ startup and get an error if I don't have the dependencies in my plugin.xml.

So my question is, can I have one plugin VcsRevisionGraph have multiple dependencies that are not strict? In other words, if Subversion is disabled, at least the CVS dependency will still work?

Or should I restructure my plugin into multiple plugins where VcsRevisionGraph is just the generic part with no actions. And then make the CVS dependent portion into its own plugin that is dependent on VcsRevisionGraph and CVS? And make a Subversion dependent portion into its own plugin that is dependent on VcsRevisionGraph and Subversion?

4 comments

Hello Shawn,

You can use optional plugin dependencies for this purpose. You can look at
the plugin.xml of the Spring plugin for one example of using this feature:

http://svn.jetbrains.org/idea/Trunk/bundled/spring/core/src/META-INF/plugin.xml

See the ]]> tags.

Note that optional dependencies have been introduced in IDEA 7.0 and don't
work in earlier versions.

I have redesigned my CVSRevisionGraph plugin to be generic for any Vcs
implementation. I called it VcsRevisionGraph. Right now, I have
added support for both CVS and Subversion. Therefore, I made the new
VcsRevisionGraph be dependent on the CVS and Subversion plugins that
ship with IntelliJ.

The problem is that if a user has disabled the Subversion plugin (via
the Plugin Manager dialog), my plugin will not load because it is
dependent on both CVS and Subversion. I thought if I just remove the
dependencies in my plugin.xml, then everything would be OK. That
didn't work. My plugin has two actions, one for CVS and one for
Subversion. These actions are loaded on IntelliJ startup and get an
error if I don't have the dependencies in my plugin.xml.

So my question is, can I have one plugin VcsRevisionGraph have
multiple dependencies that are not strict? In other words, if
Subversion is disabled, at least the CVS dependency will still work?

Or should I restructure my plugin into multiple plugins where
VcsRevisionGraph is just the generic part with no actions. And then
make the CVS dependent portion into its own plugin that is dependent
on VcsRevisionGraph and CVS? And make a Subversion dependent portion
into its own plugin that is dependent on VcsRevisionGraph and
Subversion?

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Great. However, the plugin.xml you linked to shows a min idea version of 6.0 and a max of 6.5. If the optional setting doesn't work in anything less than 7, what happens when idea 6 encounters the optional setting? Does it ignore it?

Technically speaking, would it still be better to have a base VcsRevisionGraph plugin and then make the Vcs implementation specific stuff into their own plugins that depend on VcsRevisionGraph?

0

Hello Shawn,

Great. However, the plugin.xml you linked to shows a min idea version
of 6.0 and a max of 6.5.


This setting isn't actually used: this plugin works with IDEA 7.

If the optional setting doesn't work in
anything less than 7, what happens when idea 6 encounters the optional
setting? Does it ignore it?


IDEA 6 will ignore the "optional" parameter and also will not load the optional
part of plugin.xml that depends on the other plugin (which will contain the
plugin-specific actions). So the plugin won't work.

Technically speaking, would it still be better to have a base
VcsRevisionGraph plugin and then make the Vcs implementation specific
stuff into their own plugins that depend on VcsRevisionGraph?


From the users' point of view, it's definitely more convenient to have a
single plugin which works for all the VCSes that the user has enabled. One
of the options you can take is to release your plugin as three separate plugins
for 6.0 and as one plugin with dependent parts for 7.0+ (using the since-build
and until-build fields to ensure that the users see the correct version in
their plugin manager).

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.