Code review for #343

This commit is contained in:
Jakub Chrzanowski 2023-02-06 12:50:54 +01:00 committed by Jakub Chrzanowski
parent a0cb9e5319
commit de09647c20

View File

@ -72,18 +72,17 @@ tasks {
untilBuild.set(properties("pluginUntilBuild")) untilBuild.set(properties("pluginUntilBuild"))
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription.set(providers.fileContents(layout.buildDirectory.file("README.md")).asText.map { pluginDescription.set(providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
it.lines().run {
val start = "<!-- Plugin description -->" val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->" val end = "<!-- Plugin description end -->"
with (it.lines()) {
if (!containsAll(listOf(start, end))) { if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end") throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
} }
subList(indexOf(start) + 1, indexOf(end)) subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
}.joinToString("\n").let { markdownToHTML(it) }
} }
) })
val changelog = project.changelog // local variable for configuration cache compatibility val changelog = project.changelog // local variable for configuration cache compatibility
// Get the latest available change notes from the changelog file // Get the latest available change notes from the changelog file