diff --git a/plugins/devkit/devkit-core/resources/documentation/plugin-descriptor.yaml b/plugins/devkit/devkit-core/resources/documentation/plugin-descriptor.yaml index b578e5495238..cfea3f01bf2a 100644 --- a/plugins/devkit/devkit-core/resources/documentation/plugin-descriptor.yaml +++ b/plugins/devkit/devkit-core/resources/documentation/plugin-descriptor.yaml @@ -623,6 +623,18 @@ elements: **This option isn't implemented yet and currently behaves the same way as `optional`.** defaultValue: | `optional` + - attribute: + name: required-if-available + description: | + **Experimental attribute** + + Specifies a condition when the loading rule should be restricted to 'required' instead of the rule given by the 'loading' attribute. + The value of the attribute may reference one of the special content modules that reflect the configuration of the IDE: + - `intellij.platform.frontend` + - `intellij.platform.backend` + - `intellij.platform.frontend.split` + + [Internal doc](https://youtrack.jetbrains.com/articles/IJPL-A-1503). - element: name: extensions references: diff --git a/plugins/devkit/devkit-core/resources/intellij.devkit.core.xml b/plugins/devkit/devkit-core/resources/intellij.devkit.core.xml index 272b32324229..970ac19ef926 100644 --- a/plugins/devkit/devkit-core/resources/intellij.devkit.core.xml +++ b/plugins/devkit/devkit-core/resources/intellij.devkit.core.xml @@ -44,7 +44,7 @@ + stubVersion="23"/> getLoading(); + + @NotNull + @Stubbed + GenericAttributeValue getRequiredIfAvailable(); enum ModuleLoadingRule implements NamedEnum { REQUIRED("required"), EMBEDDED("embedded"), OPTIONAL("optional"), ON_DEMAND("on-demand"); diff --git a/plugins/devkit/devkit-java-tests/testData/pluginXmlDomStubs/pluginXmlStubs.xml b/plugins/devkit/devkit-java-tests/testData/pluginXmlDomStubs/pluginXmlStubs.xml index a68c111096fb..7ef19c2d0a89 100644 --- a/plugins/devkit/devkit-java-tests/testData/pluginXmlDomStubs/pluginXmlStubs.xml +++ b/plugins/devkit/devkit-java-tests/testData/pluginXmlDomStubs/pluginXmlStubs.xml @@ -12,6 +12,10 @@ + + + + diff --git a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/codeInsight/PluginXmlDomStubsTest.java b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/codeInsight/PluginXmlDomStubsTest.java index 2e6e2ddeb205..e380c0d6a126 100644 --- a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/codeInsight/PluginXmlDomStubsTest.java +++ b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/codeInsight/PluginXmlDomStubsTest.java @@ -46,6 +46,18 @@ public class PluginXmlDomStubsTest extends DomStubTest { Element:content Element:module Attribute:name:module.name + Element:module + Attribute:name:optional.module + Attribute:loading:optional + Element:module + Attribute:name:required.module + Attribute:loading:required + Element:module + Attribute:name:ondemand.module + Attribute:loading:on-demand + Element:module + Attribute:name:required.in.frontend + Attribute:required-if-available:intellij.platform.frontend Element:dependencies Element:module Attribute:name:dependencies.module