Skip to content

Commit 776b775

Browse files
committed
Add Kotlin version to a README generation
1 parent c27a63a commit 776b775

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

build.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import java.nio.file.Paths
88
val packageName by extra("kotlin-jupyter-kernel")
99
val baseVersion: String by project
1010
val klaxonVersion: String by project
11+
val kotlinVersion: String by project
1112

1213
plugins {
1314
kotlin("jvm")
@@ -289,7 +290,7 @@ with(ProjectWithOptionsImpl(project, TaskOptions())) {
289290
val readmeFile = readmePath.toFile()
290291
val readmeStubFile = rootPath.resolve("docs").resolve("README-STUB.md").toFile()
291292
val librariesDir = File(librariesPath)
292-
val readmeGenerator = ReadmeGenerator(librariesDir)
293+
val readmeGenerator = ReadmeGenerator(librariesDir, kotlinVersion)
293294

294295
val generateReadme by tasks.registering {
295296
group = buildGroup

docs/README-STUB.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Kotlin kernel for IPython/Jupyter
88

9-
[Kotlin](https://kotlinlang.org/) (1.4.0) kernel for [Jupyter](https://jupyter.org).
9+
[Kotlin](https://kotlinlang.org/) ([[kotlin_version]]) kernel for [Jupyter](https://jupyter.org).
1010

1111
Beta version. Tested with Jupyter Notebook 6.0.3, Jupyter Lab 1.2.6 and Jupyter Console 6.1.0
1212
on Windows, Ubuntu Linux and MacOS. Using with Jupyter Console frontend is problematic now because of

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Kotlin kernel for IPython/Jupyter
88

9-
[Kotlin](https://kotlinlang.org/) (1.4.0) kernel for [Jupyter](https://jupyter.org).
9+
[Kotlin](https://kotlinlang.org/) (1.4.20-dev-3647) kernel for [Jupyter](https://jupyter.org).
1010

1111
Beta version. Tested with Jupyter Notebook 6.0.3, Jupyter Lab 1.2.6 and Jupyter Console 6.1.0
1212
on Windows, Ubuntu Linux and MacOS. Using with Jupyter Console frontend is problematic now because of

kotlin-jupyter-plugin/src/main/kotlin/org/jetbrains/kotlin/jupyter/build/readmeGenerator.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import org.jetbrains.kotlin.jupyter.common.ReplLineMagics
66
import java.io.File
77

88
class ReadmeGenerator(
9-
private val librariesDir: File
9+
private val librariesDir: File,
10+
private val kotlinVersion: String
1011
) {
1112
fun generate(stub: File, destination: File) {
1213
var result = stub.readText()
@@ -19,7 +20,8 @@ class ReadmeGenerator(
1920
private val processors: Map<String, () -> String> = mapOf(
2021
"supported_libraries" to ::processSupportedLibraries,
2122
"supported_commands" to ::processCommands,
22-
"magics" to ::processMagics
23+
"magics" to ::processMagics,
24+
"kotlin_version" to ::processKotlinVersion
2325
)
2426

2527
private fun processSupportedLibraries(): String {
@@ -55,4 +57,8 @@ class ReadmeGenerator(
5557
description + usage
5658
}
5759
}
60+
61+
private fun processKotlinVersion(): String {
62+
return kotlinVersion
63+
}
5864
}

0 commit comments

Comments
 (0)