Skip to content

Commit

Permalink
intellijPlatform.pluginConfiguration.description appends content in…
Browse files Browse the repository at this point in the history
…stead of replacing it #1744
  • Loading branch information
hsz committed Sep 3, 2024
1 parent 72ea20e commit 21ab0e6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Added `PrepareSandboxTask.pluginName` for easier accessing of the plugin directory name

### Fixed

- `intellijPlatform.pluginConfiguration.description` appends content instead of replacing it [#1744](../../issues/1744)

## [2.0.1] - 2024-08-08

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ abstract class PatchPluginXmlTask : DefaultTask(), IntelliJPlatformVersionAware
log.warn("Patching plugin.xml: value of '$tagName[$existingValue]' tag will be set to '$value'")
}
when {
isCDATA -> element.addContent(CDATA(value))
isCDATA -> element.setContent(CDATA(value))
else -> element.text = value
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class PatchPluginXmlTaskTest : IntelliJPluginTestBase() {
}

@Test
fun `ignore unseting the until-build with null passed to extension`() {
fun `ignore unsetting the until-build with null passed to extension`() {
pluginXml write //language=xml
"""
<idea-plugin />
Expand Down Expand Up @@ -383,4 +383,36 @@ class PatchPluginXmlTaskTest : IntelliJPluginTestBase() {
assertNotContains("will be overwritten", output)
}
}

@Test
fun `override the description specified in the XML file`() {
pluginXml write //language=xml
"""
<idea-plugin>
<description>Foo</description>
</idea-plugin>
""".trimIndent()

buildFile write //language=kotlin
"""
intellijPlatform {
pluginConfiguration {
description = "Bar"
}
}
""".trimIndent()

build(Tasks.PATCH_PLUGIN_XML) {
assertFileContent(
patchedPluginXml,
"""
<idea-plugin>
<idea-version since-build="223.8836" until-build="223.*" />
<version>1.0.0</version>
<description><![CDATA[Bar]]></description>
</idea-plugin>
""".trimIndent(),
)
}
}
}

0 comments on commit 21ab0e6

Please sign in to comment.