Skip to content

Commit

Permalink
[build] no need to patch the Database plugin for WebStorm as it's bun…
Browse files Browse the repository at this point in the history
…dled with WebStorm 2024.3 (WEB-68774)

And bundled plugins are not available as artifacts in `WS-plugins/auto-uploading` directory => the Database plugin is no longer uploaded to the Marketplace as a part of the WebStorm release process.

GitOrigin-RevId: 38165b36050dab4b124736450e8ef59668c1cedf
  • Loading branch information
segrey authored and intellij-monorepo-bot committed Dec 2, 2024
1 parent 575eb54 commit 7bf7782
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,28 +137,6 @@ fun doPatchPluginXml(
}
}

// patch Database plugin for WebStorm, see WEB-48278
if (toPublish && productDescriptor != null && productDescriptor.getAttributeValue("code") == "PDB") {
Span.current().addEvent("patch $pluginModuleName for WebStorm")
val pluginName = rootElement.getChild("name")
check(pluginName.text == "Database Tools and SQL") { "Plugin name for '$pluginModuleName' should be 'Database Tools and SQL'" }
pluginName.text = "Database Tools and SQL for WebStorm"
val description = rootElement.getChild("description")
val replaced1 = replaceInElementText(element = description, oldText = "IntelliJ-based IDEs", newText = "WebStorm")
check(replaced1) { "Could not find 'IntelliJ-based IDEs' in plugin description of $pluginModuleName" }

val oldText = "The plugin provides all the same features as <a href=\"https://www.jetbrains.com/datagrip/\">DataGrip</a>, the standalone JetBrains IDE for databases."
val replaced2 = replaceInElementText(
element = description,
oldText = oldText,
newText = """
The plugin provides all the same features as <a href="https://www.jetbrains.com/datagrip/">DataGrip</a>, the standalone JetBrains IDE for databases.
Owners of an active DataGrip subscription can download the plugin for free.
The plugin is also included in <a href="https://www.jetbrains.com/all/">All Products Pack</a> and <a href="https://www.jetbrains.com/community/education/">Student Pack</a>.
""".trimIndent()
)
check(replaced2) { "Could not find '$oldText' in plugin description of $pluginModuleName" }
}
return rootElement
}

Expand All @@ -183,18 +161,6 @@ fun getOrCreateTopElement(rootElement: Element, tagName: String, anchors: List<S
return newElement
}

@Suppress("SameParameterValue")
private fun replaceInElementText(element: Element, oldText: String, newText: String): Boolean {
val textBefore = element.text
val text = textBefore.replace(oldText, newText)
if (textBefore == text) {
return false
}

element.text = text
return true
}

private fun setProductDescriptorEapAttribute(productDescriptor: Element, isEap: Boolean) {
if (isEap) {
productDescriptor.setAttribute("eap", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,41 +167,6 @@ class PluginXmlPatcherTest {
isEap = true
)

@Test
fun patchDatabasePluginInWebStorm() = assertTransform(
"""
<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude">
<name>Database Tools and SQL</name>
<id>com.intellij.database</id>
<product-descriptor code="PDB" release-date="__DATE__" release-version="__VERSION__"/>
<description>
<![CDATA[
The Database Tools and SQL plugin for IntelliJ-based IDEs allows you to query, create, and manage databases and provides full SQL language support.
<br><br>
The plugin provides all the same features as <a href="https://www.jetbrains.com/datagrip/">DataGrip</a>, the standalone JetBrains IDE for databases.
<br><br>
]]>
</description>
</idea-plugin>
""".trimIndent(),
"""
<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude">
<name>Database Tools and SQL for WebStorm</name>
<id>com.intellij.database</id>
<version>x-plugin-version</version>
<idea-version since-build="new-since" until-build="new-until" />
<product-descriptor code="PDB" release-date="X-RELEASE-DATE-X" release-version="X-RELEASE-VERSION-X" />
<description>The Database Tools and SQL plugin for WebStorm allows you to query, create, and manage databases and provides full SQL language support.
&lt;br&gt;&lt;br&gt;
The plugin provides all the same features as &lt;a href=&quot;https://www.jetbrains.com/datagrip/&quot;&gt;DataGrip&lt;/a&gt;, the standalone JetBrains IDE for databases.
Owners of an active DataGrip subscription can download the plugin for free.
The plugin is also included in &lt;a href=&quot;https://www.jetbrains.com/all/&quot;&gt;All Products Pack&lt;/a&gt; and &lt;a href=&quot;https://www.jetbrains.com/community/education/&quot;&gt;Student Pack&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;</description>
</idea-plugin>
""".trimIndent(),
toPublish = true,
)

@Test
fun doNotPatchDatabasePluginIfBundled() = assertTransform(
"""
Expand Down

0 comments on commit 7bf7782

Please sign in to comment.