plugin_content.md: rework trees using PlantUML, minor edits

This commit is contained in:
Yann Cébron 2024-01-31 11:45:21 +01:00
parent c526380174
commit b03104b61a

View File

@ -1,18 +1,19 @@
# Plugin Content
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<link-summary>Layout and contents of a plugin distribution file.</link-summary>
Plugin distribution will be built using [Gradle](tools_gradle_intellij_plugin.md#tasks-buildplugin) or [Plugin DevKit](deploying_theme.md).
The plugin <path>.jar</path> file must contain:
The plugin distribution <path>.jar</path> file contains:
- the configuration file (<path>META-INF/plugin.xml</path>) ([Plugin Configuration File](plugin_configuration_file.md))
- the classes that implement the plugin functionality
- configuration file (<path>META-INF/plugin.xml</path>) ([Plugin Configuration File](plugin_configuration_file.md))
- classes implementing the plugin functionality
- recommended: plugin logo file(s) (<path>META-INF/pluginIcon*.svg</path>) ([Plugin Logo](plugin_icon_file.md))
See [](plugin_user_experience.md#distribution-size) for important steps to optimize the plugin distribution file.
> See [](plugin_user_experience.md#distribution-size) for important steps to optimize the plugin distribution file.
Targeting a plugin distribution to a specific OS is not possible ([issue](https://youtrack.jetbrains.com/issue/MP-1896)).
@ -20,17 +21,27 @@ Targeting a plugin distribution to a specific OS is not possible ([issue](https:
A plugin consisting of a single <path>.jar</path> file is placed in the <path>/plugins</path> directory.
```text
.IntelliJIDEAx0/
└── plugins
└── sample.jar
├── com/company/sample/SamplePluginService.class
│ ...
│ ...
└── META-INF
├── plugin.xml
├── pluginIcon.svg
└── pluginIcon_dark.svg
```plantuml
@startuml
skinparam TitleFontName JetBrains Sans
skinparam TitleFontStyle plain
skinparam TitleFontSize 16
title
|_ .IntelliJIDEAx0
|_ plugins
|_ sample.jar // (Plugin distribution) //
|_ com
|_ company
|_ Sample.class // (Class ""com.company.Sample"") //
|_ ...
|_ META-INF
|_ plugin.xml // (Plugin Configuration File) //
|_ pluginIcon.svg // (Plugin Logo) //
|_ pluginIcon_dark.svg // (Plugin Logo, dark variant) //
end title
@enduml
```
### Plugin With Dependencies
@ -42,23 +53,32 @@ All jars from the <path>/lib</path> folder are automatically added to the classp
> Do not repackage libraries into the main plugin archive (<path>sample.jar</path> in the sample below).
> Otherwise, [Plugin Verifier](verifying_plugin_compatibility.md) will yield false positives for unresolved classes and methods.
>
{style="warning"}
{title="Do Not Repackage Libraries" style="warning"}
```text
.IntelliJIDEAx0/
└── plugins
└── sample
└── lib
├── lib_foo.jar
├── lib_bar.jar
│ ...
│ ...
└── sample.jar
├── com/company/sample/SamplePluginService.class
│ ...
│ ...
└── META-INF
├── plugin.xml
├── pluginIcon.svg
└── pluginIcon_dark.svg
```plantuml
@startuml
skinparam TitleFontName JetBrains Sans
skinparam TitleFontStyle plain
skinparam TitleFontSize 16
title
|_ .IntelliJIDEAx0
|_ plugins
|_ sample
|_ lib
|_ lib_foo.jar // (Required bundled library #1) //
|_ lib_bar.jar // (Required bundled library #2) //
|_ ...
|_ sample.jar // (Plugin distribution) //
|_ com
|_ company
|_ Sample.class // (Class ""com.company.Sample"") //
|_ ...
|_ META-INF
|_ plugin.xml // (Plugin Configuration File) //
|_ pluginIcon.svg // (Plugin Logo) //
|_ pluginIcon_dark.svg // (Plugin Logo, dark variant) //
end title
@enduml
```