mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 10:17:50 +08:00
Update plugin compatibility page
This commit is contained in:
parent
754b49004c
commit
f8107e38ef
@ -4,10 +4,13 @@ title: Plugin Compatibility with IntelliJ Platform Products
|
||||
|
||||
<!--TODO link to sample_plugin file-->
|
||||
|
||||
All products based on IntelliJ Platform (IntelliJ IDEA, RubyMine, WebStorm, PhpStorm, PyCharm, AppCode, etc.) share the same underlying platform API. Thus, a plugin that does not use any Java-specific functionality may be marked as compatible with these other products in addition to IntelliJ IDEA. This is done by specifying *module dependencies* in the `plugin.xml` file.
|
||||
All products based on the _IntelliJ Platform_, such as IntelliJ IDEA, RubyMine, WebStorm, and so on, target the same underlying platform API, with some products sharing features built on top of the platform, such as Java support (IntelliJ IDEA
|
||||
and Android Studio) or database support (IntelliJ IDEA Ultimate, DataGrip, PhpStorm, etc.).
|
||||
|
||||
It is possible to write a plugin that is compatible across multiple products, as long as the plugin specifies which product it is compatible with. More specifically, the plugin must specify, using [the `<depends>` tag](http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html) in the [`plugin.xml` file](http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_configuration_file.html), dependencies on well known _modules_ or plugins.
|
||||
|
||||
For the purposes of dependencies, a module can be thought of as a built-in plugin that ships as a non-removable part of a product. Not all products define and declare modules. For example, PhpStorm and GoLand do not have their own modules, but the products themselves depend on (and ship) the language specific plugins. You can make your plugin compatible with these products by also depending on the same language plugins.
|
||||
|
||||
A module dependency is a `<depends>` tag where the contents of the tag starts with `com.intellij.modules`.
|
||||
|
||||
For example:
|
||||
|
||||
```xml
|
||||
@ -22,7 +25,7 @@ For example:
|
||||
|
||||
If a plugin does not include any module dependency tags in its `plugin.xml`, it's assumed to be a legacy plugin and is loaded only in IntelliJ IDEA.
|
||||
|
||||
If the `plugin.xml` includes one or more such tags, the plugin is loaded if the product contains all of the modules on which the plugin depends.
|
||||
If the `plugin.xml` includes one or more such tags, the plugin is loaded if the product contains **all** of the modules on which the plugin depends.
|
||||
|
||||
The following modules are currently available in all products based on IntelliJ Platform:
|
||||
|
||||
@ -32,9 +35,11 @@ The following modules are currently available in all products based on IntelliJ
|
||||
* `com.intellij.modules.xml`
|
||||
* `com.intellij.modules.xdebugger`
|
||||
|
||||
The following modules are only available in specific products:
|
||||
This means a plugin can declare a dependency on `com.intellij.modules.vcs` and it will work in any product that supports version control, and since all products currently include the `com.intellij.modules.vcs` module, this plugin will work in all products.
|
||||
|
||||
| Module | Product |
|
||||
The following modules or built-in plugins are available in these specific products:
|
||||
|
||||
| Module or built-in plugin | Product |
|
||||
|--------------------------------------|-----------------------------------------------------------------------|
|
||||
| `com.intellij.modules.java` | IntelliJ IDEA, Android Studio |
|
||||
| `com.intellij.modules.ultimate` | IntelliJ IDEA Ultimate Edition |
|
||||
@ -44,16 +49,19 @@ The following modules are only available in specific products:
|
||||
| `com.intellij.modules.cidr.debugger` | AppCode, CLion, RubyMotion |
|
||||
| `com.intellij.modules.clion` | CLion |
|
||||
| `com.intellij.modules.database` | IntelliJ IDEA Ultimate Edition, DataGrip, PhpStorm, PyCharm, RubyMine |
|
||||
| `com.intellij.modules.go` | GoLand |
|
||||
| `com.intellij.modules.python` | PyCharm |
|
||||
| `com.intellij.modules.rider` | Rider |
|
||||
| `com.intellij.modules.ruby` | RubyMine |
|
||||
| `com.jetbrains.php` | PhpStorm (built-in plugin) |
|
||||
| `org.jetbrains.plugins.go` | GoLand (built-in plugin) |
|
||||
|
||||
PhpStorm does not have any modules specific to itself, but it includes the PHP plugin, which you can also use as a dependency: `com.jetbrains.php`
|
||||
## Plugin dependencies
|
||||
|
||||
If you want to add a dependency to a specific plugin, then add a module dependency tag based on its plugin name/ID to the `plugin.xml`. For example `JavaScript` or `tslint`. Note that some plugins are not included by default in the target SDK, so you also have to add their jars manually to the SDKs classpath to compile against their provided classes. Make sure that you add the plugin jars to the SDK and not to your plugin, else the jars will be bundled with your plugin.
|
||||
If you want to add a dependency to a plugin, then add a `<depends>` tag using the plugin name/ID to `plugin.xml`. For example `JavaScript` or `tslint`. Note that some plugins are not included by default in the target SDK, so you also have to add their jars manually to the SDKs classpath to compile against their provided classes. Make sure that you add the plugin jars to the SDK and not to your plugin, else the jars will be bundled with your plugin.
|
||||
|
||||
You can also specify optional module dependencies. If your plugin works with all products but provides some Java-specific functionality, you can use a dependency tag like this:
|
||||
## Optional dependencies
|
||||
|
||||
You can also specify optional dependencies. If your plugin works with all products but provides some Java-specific functionality, you can use a dependency tag like this:
|
||||
|
||||
```xml
|
||||
<depends optional="true" config-file="my-java-features.xml">
|
||||
@ -61,9 +69,8 @@ You can also specify optional module dependencies. If your plugin works with all
|
||||
</depends>
|
||||
```
|
||||
|
||||
Before marking a plugin as compatible with all products, you should verify that it doesn't use any APIs that are specific to IntelliJ IDEA. To do so, create an IntelliJ Platform SDK pointing to an installation of RubyMine, PyCharm, etc., compile your plugin against that SDK, and verify that everything compiles. Visit https://www.jetbrains.com/buy/opensource/ to check if your project is eligible for free Open Source Licenses of JetBrains products.
|
||||
Before marking a plugin as compatible with all products, you should verify that it doesn't use any APIs that are specific to IntelliJ IDEA. To do so, create an _IntelliJ Platform_ SDK pointing to an installation of RubyMine, PyCharm, etc., compile your plugin against that SDK, and verify that everything compiles. Visit the [Open Source Licensing page](https://www.jetbrains.com/buy/opensource/) to check if your project is eligible for free Open Source Licenses of JetBrains products.
|
||||
|
||||
The [IntelliJ plugin repository](http://plugins.jetbrains.com/) automatically detects the products with which a plugin is compatible, based on the rules above, and makes it available to users of those products.
|
||||
|
||||
API of IntelliJ Platform and bundled plugins may be changed between releases. The major changes which may break plugins are listed on [Incompatible Changes in IntelliJ Platform and Plugins API](/reference_guide/api_changes_list.md) page.
|
||||
|
||||
The API of _IntelliJ Platform_ and bundled plugins may be changed between releases. The major changes which may break plugins are listed on [Incompatible Changes in _IntelliJ Platform_ and Plugins API](/reference_guide/api_changes_list.md) page.
|
||||
|
Loading…
x
Reference in New Issue
Block a user