diff --git a/build.gradle.kts b/build.gradle.kts index b70db04..52da861 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import io.gitlab.arturbosch.detekt.Detekt +import org.jetbrains.changelog.Changelog import org.jetbrains.changelog.date import org.jetbrains.changelog.markdownToHTML import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -92,27 +93,30 @@ tasks { patchPluginXml { version.set(properties("pluginVersion")) sinceBuild.set(properties("pluginSinceBuild")) - if (project.hasProperty("pluginUntilBuild")) { + if (project.hasProperty("pluginUntilBuild")) { untilBuild.set(properties("pluginUntilBuild")) } // Extract the section from README.md and provide for the plugin's manifest pluginDescription.set( - File(projectDir, "README.md").readText().lines().run { - val start = "" - val end = "" - - if (!containsAll(listOf(start, end))) { - throw GradleException("Plugin description section not found in README.md:\n$start ... $end") - } - subList(indexOf(start) + 1, indexOf(end)) - }.joinToString("\n").run { markdownToHTML(this) } + File(projectDir, "README.md").readText().lines().run { + val start = "" + val end = "" + + if (!containsAll(listOf(start, end))) { + throw GradleException("Plugin description section not found in README.md:\n$start ... $end") + } + subList(indexOf(start) + 1, indexOf(end)) + }.joinToString("\n").run { markdownToHTML(this) } ) // Get the latest available change notes from the changelog file changeNotes.set(provider { - changelog.getAll().filterKeys { it != "[Unreleased]" } - .values.joinToString("") { it.withHeader(true).toHTML() } + changelog.getAll() + .filterKeys { it != "[Unreleased]" } + .values.joinToString("") { + changelog.renderItem(it.withHeader(true), Changelog.OutputType.HTML) + } }) }