Multi module sample and guidance

Hi!

My plugin is currently a single module, but as the codebase becomes bigger, I would like to split it in several modules.

I’m having a hard time finding documentation about how to do this.

Is there a simple sample that I can look at somewhere?

In particular, what is the difference between:

  • pluginModule(dependency)
  • localPlugin(localPath)

?

Thank you.

In my experience, let’s say your Gradle project has sub-projects: A, B, C, One, Two. Among them, A, B, and C are modules, and One and Two are two plugins. It has the following relationships:

@startuml

[Plugin Module A]
[Plugin Module B]
[Plugin Module C]
[Plugin One]
[Plugin Two]

[Plugin One] ---* [Plugin Module A] : pluginModule
[Plugin One] ---* [Plugin Module B] : pluginModule
[Plugin Two] ---* [Plugin Module B] : PluginModule
[Plugin Two] ----* [Plugin Module C] : pluginModule
[Plugin Two] -[dashed]-> [Plugin One] : localPlugin / plugins / bundledPlugins


@enduml

  • pluginModule(dependency) : When Build Plugin One, the classes in A and B are merged into Plugin One (jar).
    When Build Plugin Two, the classes in B and C are merged into Plugin Two.
  • localPlugin/plugins/bundledPlugins: compile time or runtime dependency. you build Plugin Two will need Plugin One. And User install Plugin Two may request to install Plugin One too.

Thanks, that helps.

I’m guessing having a project with multiple plugins must be an advanced/rare scenario?