Skip to content

Commit

Permalink
1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
altavir committed Aug 21, 2023
1 parent 8a864f9 commit c249dc5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
26 changes: 13 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
21 changes: 11 additions & 10 deletions src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,18 @@ public open class KScienceProjectPlugin : Plugin<Project> {
val modulesString = buildString {
subprojects.forEach { subproject ->
// val name = subproject.name
subproject.extensions.findByType<KScienceReadmeExtension>()?.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<KScienceReadmeExtension>()
?.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)
}
}
}
}
}

Expand Down
11 changes: 9 additions & 2 deletions src/main/kotlin/space/kscience/gradle/KScienceReadmeExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +33,8 @@ private fun Template.processToString(args: Map<String, Any?>): 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) {
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit c249dc5

Please sign in to comment.