From de09647c20a853c9a5c5ca295d3cd55792bebb97 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 6 Feb 2023 12:50:54 +0100 Subject: [PATCH] Code review for #343 --- build.gradle.kts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7100359..0cff5f8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,7 +53,7 @@ qodana { cachePath.set(provider { file(".qodana").canonicalPath }) reportPath.set(provider { file("build/reports/inspections").canonicalPath }) saveReport.set(true) - showReport.set(environment("QODANA_SHOW_REPORT").map { it.toBoolean() } .getOrElse(false)) + showReport.set(environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)) } // Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration @@ -72,18 +72,17 @@ tasks { untilBuild.set(properties("pluginUntilBuild")) // Extract the section from README.md and provide for the plugin's manifest - pluginDescription.set(providers.fileContents(layout.buildDirectory.file("README.md")).asText.map { - it.lines().run { - val start = "" - val end = "" + pluginDescription.set(providers.fileContents(layout.projectDirectory.file("README.md")).asText.map { + 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").let { markdownToHTML(it) } + with (it.lines()) { + 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").let(::markdownToHTML) } - ) + }) val changelog = project.changelog // local variable for configuration cache compatibility // Get the latest available change notes from the changelog file