From 9dcd4ef23b1ce48f2d872544d81659b7f1d98fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20Br=C3=BCnings?= Date: Fri, 27 Jan 2023 10:46:52 +0100 Subject: [PATCH] Improve changes notes and plugin description provider handling --- build.gradle.kts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4b322bf..096b8cf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -72,8 +72,8 @@ tasks { untilBuild.set(properties("pluginUntilBuild")) // Extract the section from README.md and provide for the plugin's manifest - pluginDescription.set(provider { - file("README.md").readText().lines().run { + pluginDescription.set(providers.fileContents(layout.buildDirectory.file("README.md")).asText.map { + it.lines().run { val start = "" val end = "" @@ -86,10 +86,10 @@ tasks { ) // Get the latest available change notes from the changelog file - changeNotes.set(provider { + changeNotes.set(properties("pluginVersion").map { pluginVersion -> with(changelog) { renderItem( - getOrNull(properties("pluginVersion").get()) + getOrNull(pluginVersion) ?: runCatching { getLatest() }.getOrElse { getUnreleased() }, Changelog.OutputType.HTML, )