positron
positron

Reputation: 3693

Plugin dependencies

Consider following scenario. There are three plugins: pluginA, pluginB and pluginC. PluginA has a dependency on pluginB and re-exports it. PluginC wants to utilize pluginB and has dependency on pluginA. Since there is dependency pluginC -> pluginA -> pluginB, does pluginC need to add pluginB as its dependency?

I believe that it shouldn't. However, if I add direct dependency pluginC -> pluginB everything works fine, but if I remove that dependency and just leave pluginC -> pluginA, then I get errors stating that classes from pluginB cannot be found. Under what circumstances would I get these errors? Does it depend on the types of plugins (UI vs non-UI)?

Thanks, Alex

Upvotes: 1

Views: 102

Answers (1)

E-Riz
E-Riz

Reputation: 33024

The transitive dependency (C depends on A depends on B) does work; I just tested a simple case to make sure. Make certain that PluginB is exporting whatever packages PluginC is trying to use. If that's not the problem, maybe you can update the question with more detail about the errors.

In general, I avoid using the re-export feature because it is less explicit and can introduce unintended dependencies (or at least, dependencies that you are not aware of). Instead, I either make all dependencies explicit (PluginC would depend on PluginB directly) or use Imported Packages instead (which doesn't care what plugin the packages come from, just that they have to be available from somewhere); it's more flexible.

Upvotes: 3

Related Questions