Use only hard dependency to java module and use include for jvm.xml (KT-23638)

Trick with both optional/non-optional dependency doesn't work in IDEA,
as it doesn't do an additional check optional dependency is found.

See com.intellij.ide.plugins.PluginManagerCore#checkDependants(
  IdeaPluginDescriptor, Function<PluginId, IdeaPluginDescriptor>,
  Condition<PluginId>, Set<PluginId>)

 #KT-23638 Fixed
This commit is contained in:
Nikolay Krasko
2018-04-11 21:07:56 +03:00
parent 03cca448d3
commit c4917d6d1c
7 changed files with 43 additions and 19 deletions
+6 -3
View File
@@ -27,11 +27,10 @@
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
<!-- CLION-PLUGIN-PLACEHOLDER-START -->
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
<depends>com.intellij.modules.java</depends>
<depends optional="true" config-file="jvm.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
<!-- CLION-PLUGIN-PLACEHOLDER-END -->
<!-- CIDR-PLUGIN-PLACEHOLDER-END -->
<project-components>
<component>
@@ -2822,6 +2821,10 @@
<checkinHandlerFactory implementation="org.jetbrains.kotlin.idea.vcs.BunchFileCheckInHandlerFactory"/>
</extensions>
<!-- CIDR-PLUGIN-EXCLUDE-START -->
<xi:include href="jvm.xml" xpointer="xpointer(/idea-plugin/*)"/>
<!-- CIDR-PLUGIN-EXCLUDE-END -->
<xi:include href="tipsAndTricks.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="extensions/ide.xml" xpointer="xpointer(/idea-plugin/*)"/>
+6 -3
View File
@@ -27,11 +27,10 @@
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
<!-- CLION-PLUGIN-PLACEHOLDER-START -->
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
<depends>com.intellij.modules.java</depends>
<depends optional="true" config-file="jvm.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
<!-- CLION-PLUGIN-PLACEHOLDER-END -->
<!-- CIDR-PLUGIN-PLACEHOLDER-END -->
<project-components>
<component>
@@ -2824,6 +2823,10 @@
<checkinHandlerFactory implementation="org.jetbrains.kotlin.idea.vcs.BunchFileCheckInHandlerFactory"/>
</extensions>
<!-- CIDR-PLUGIN-EXCLUDE-START -->
<xi:include href="jvm.xml" xpointer="xpointer(/idea-plugin/*)"/>
<!-- CIDR-PLUGIN-EXCLUDE-END -->
<xi:include href="tipsAndTricks.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="extensions/ide.xml" xpointer="xpointer(/idea-plugin/*)"/>
+6 -3
View File
@@ -27,11 +27,10 @@
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
<!-- CLION-PLUGIN-PLACEHOLDER-START -->
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
<depends>com.intellij.modules.java</depends>
<depends optional="true" config-file="jvm.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
<!-- CLION-PLUGIN-PLACEHOLDER-END -->
<!-- CIDR-PLUGIN-PLACEHOLDER-END -->
<project-components>
<component>
@@ -2822,6 +2821,10 @@
<checkinHandlerFactory implementation="org.jetbrains.kotlin.idea.vcs.BunchFileCheckInHandlerFactory"/>
</extensions>
<!-- CIDR-PLUGIN-EXCLUDE-START -->
<xi:include href="jvm.xml" xpointer="xpointer(/idea-plugin/*)"/>
<!-- CIDR-PLUGIN-EXCLUDE-END -->
<xi:include href="tipsAndTricks.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="extensions/ide.xml" xpointer="xpointer(/idea-plugin/*)"/>
+6 -3
View File
@@ -28,11 +28,10 @@
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
<!-- CLION-PLUGIN-PLACEHOLDER-START -->
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
<depends>com.intellij.modules.java</depends>
<depends optional="true" config-file="jvm.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
<!-- CLION-PLUGIN-PLACEHOLDER-END -->
<!-- CIDR-PLUGIN-PLACEHOLDER-END -->
<project-components>
<component>
@@ -2823,6 +2822,10 @@
<checkinHandlerFactory implementation="org.jetbrains.kotlin.idea.vcs.BunchFileCheckInHandlerFactory"/>
</extensions>
<!-- CIDR-PLUGIN-EXCLUDE-START -->
<xi:include href="jvm.xml" xpointer="xpointer(/idea-plugin/*)"/>
<!-- CIDR-PLUGIN-EXCLUDE-END -->
<xi:include href="tipsAndTricks.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="extensions/ide.xml" xpointer="xpointer(/idea-plugin/*)"/>
+6 -3
View File
@@ -28,11 +28,10 @@
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
<!-- CLION-PLUGIN-PLACEHOLDER-START -->
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
<depends>com.intellij.modules.java</depends>
<depends optional="true" config-file="jvm.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
<!-- CLION-PLUGIN-PLACEHOLDER-END -->
<!-- CIDR-PLUGIN-PLACEHOLDER-END -->
<project-components>
<component>
@@ -2823,6 +2822,10 @@
<checkinHandlerFactory implementation="org.jetbrains.kotlin.idea.vcs.BunchFileCheckInHandlerFactory"/>
</extensions>
<!-- CIDR-PLUGIN-EXCLUDE-START -->
<xi:include href="jvm.xml" xpointer="xpointer(/idea-plugin/*)"/>
<!-- CIDR-PLUGIN-EXCLUDE-END -->
<xi:include href="tipsAndTricks.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="extensions/ide.xml" xpointer="xpointer(/idea-plugin/*)"/>
+6 -3
View File
@@ -29,11 +29,10 @@
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
<!-- CLION-PLUGIN-PLACEHOLDER-START -->
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
<depends>com.intellij.modules.java</depends>
<depends optional="true" config-file="jvm.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
<!-- CLION-PLUGIN-PLACEHOLDER-END -->
<!-- CIDR-PLUGIN-PLACEHOLDER-END -->
<project-components>
<component>
@@ -2824,6 +2823,10 @@
<checkinHandlerFactory implementation="org.jetbrains.kotlin.idea.vcs.BunchFileCheckInHandlerFactory"/>
</extensions>
<!-- CIDR-PLUGIN-EXCLUDE-START -->
<xi:include href="jvm.xml" xpointer="xpointer(/idea-plugin/*)"/>
<!-- CIDR-PLUGIN-EXCLUDE-END -->
<xi:include href="tipsAndTricks.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="extensions/ide.xml" xpointer="xpointer(/idea-plugin/*)"/>
+7 -1
View File
@@ -30,8 +30,13 @@ val pluginXml by tasks.creating {
doFirst {
val placeholderRegex = Regex(
"""<!-- CLION-PLUGIN-PLACEHOLDER-START -->(.*)<!-- CLION-PLUGIN-PLACEHOLDER-END -->""",
"""<!-- CIDR-PLUGIN-PLACEHOLDER-START -->(.*)<!-- CIDR-PLUGIN-PLACEHOLDER-END -->""",
RegexOption.DOT_MATCHES_ALL)
val excludeRegex = Regex(
"""<!-- CIDR-PLUGIN-EXCLUDE-START -->(.*)<!-- CIDR-PLUGIN-EXCLUDE-END -->""",
RegexOption.DOT_MATCHES_ALL)
val versionRegex = Regex("""<version>([^<]+)</version>""")
zipTree(inputs.files.singleFile)
@@ -39,6 +44,7 @@ val pluginXml by tasks.creating {
.singleFile
.readText()
.replace(placeholderRegex, "")
.replace(excludeRegex, "")
.replace(versionRegex, "<version>$pluginFullVersionNumber</version>")
.also { pluginXmlText ->
outputs.files.singleFile.writeText(pluginXmlText)