From c249dc5ae4924b8500d8084f22ce3268c23b18b0 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Mon, 21 Aug 2023 18:26:17 +0300 Subject: [PATCH] 1.9.0 --- gradle/libs.versions.toml | 26 +++++++++---------- .../kscience/gradle/KScienceProjectPlugin.kt | 21 ++++++++------- .../gradle/KScienceReadmeExtension.kt | 11 ++++++-- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7274cfe..8103a9f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,25 +1,25 @@ [versions] -tools = "0.14.9-kotlin-1.9.0" +tools = "0.14.10-kotlin-1.9.0" kotlin = "1.9.0" -atomicfu = "0.20.2" -binary-compatibility-validator = "0.13.1" -changelog = "2.0.0" -dokka = "1.8.10" -kotlin-jupyter = "0.11.0-360" -kotlinx-benchmark = "0.4.7" +atomicfu = "0.22.0" +binary-compatibility-validator = "0.13.2" +changelog = "2.1.2" +dokka = "1.8.20" +kotlin-jupyter = "0.12.0-43" +kotlinx-benchmark = "0.4.9" kotlinx-cli = "0.3.5" -kotlinx-coroutines = "1.7.2" +kotlinx-coroutines = "1.7.3" kotlinx-datetime = "0.4.0" -kotlinx-html = "0.8.0" +kotlinx-html = "0.9.1" kotlinx-knit = "0.4.0" kotlinx-nodejs = "0.0.7" kotlinx-serialization = "1.5.1" -ktor = "2.3.0" -xmlutil = "0.86.0" +ktor = "2.3.3" +xmlutil = "0.86.1" yamlkt = "0.13.0" -jsBom = "1.0.0-pre.546" +jsBom = "1.0.0-pre.618" junit = "5.9.3" -compose = "1.4.0" +compose = "1.5.0-rc01" logback = "1.4.7" [libraries] diff --git a/src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt b/src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt index fded38d..3257e82 100644 --- a/src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt +++ b/src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt @@ -205,17 +205,18 @@ public open class KScienceProjectPlugin : Plugin { val modulesString = buildString { subprojects.forEach { subproject -> // val name = subproject.name - subproject.extensions.findByType()?.let { ext -> - val path = subproject.path.replaceFirst(":", "").replace(":", "/") - appendLine("\n### [$path]($path)") - appendLine("> ${ext.description}") - appendLine(">\n> **Maturity**: ${ext.maturity}") - val featureString = ext.featuresString(itemPrefix = "> - ", pathPrefix = "$path/") - if (featureString.isNotBlank()) { - appendLine(">\n> **Features:**") - appendLine(featureString) + subproject.extensions.findByType() + ?.let { ext: KScienceReadmeExtension -> + val path = subproject.path.replaceFirst(":", "").replace(":", "/") + appendLine("\n### [$path]($path)") + ext.description?.let { appendLine("> ${ext.description}") } + appendLine(">\n> **Maturity**: ${ext.maturity}") + val featureString = ext.featuresString(itemPrefix = "> - ", pathPrefix = "$path/") + if (featureString.isNotBlank()) { + appendLine(">\n> **Features:**") + appendLine(featureString) + } } - } } } diff --git a/src/main/kotlin/space/kscience/gradle/KScienceReadmeExtension.kt b/src/main/kotlin/space/kscience/gradle/KScienceReadmeExtension.kt index a63fa26..af16822 100644 --- a/src/main/kotlin/space/kscience/gradle/KScienceReadmeExtension.kt +++ b/src/main/kotlin/space/kscience/gradle/KScienceReadmeExtension.kt @@ -10,6 +10,7 @@ import kotlinx.html.stream.createHTML import kotlinx.validation.ApiValidationExtension import org.gradle.api.Project import org.gradle.kotlin.dsl.findByType +import org.intellij.lang.annotations.Language import java.io.File import java.io.StringWriter import kotlin.collections.component1 @@ -32,7 +33,8 @@ private fun Template.processToString(args: Map): String { public class KScienceReadmeExtension(public val project: Project) { - public var description: String = project.description ?: "" + public var description: String? = null + get() = field ?: project.description public var maturity: Maturity = Maturity.EXPERIMENTAL set(value) { @@ -93,7 +95,12 @@ public class KScienceReadmeExtension(public val project: Project) { /** * A plain readme feature with description */ - public fun feature(id: String, ref: String? = null, name: String = id, description: () -> String) { + public fun feature( + id: String, + @Language("File") ref: String? = null, + name: String = id, + description: () -> String, + ) { features += Feature(id, description(), ref, name) }