Skip to content

Commit eeb9b50

Browse files
committed
Setup versions plugin and update libraries versions
1 parent d6c68c3 commit eeb9b50

File tree

7 files changed

+37
-23
lines changed

7 files changed

+37
-23
lines changed

build-tools/build-plugin/src/build/kernelBuild.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package build
22

3+
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
34
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
45
import com.github.jengelman.gradle.plugins.shadow.transformers.ComponentsXmlResourceTransformer
56
import kotlinx.serialization.Serializable
@@ -20,6 +21,7 @@ import org.gradle.kotlin.dsl.create
2021
import org.gradle.kotlin.dsl.get
2122
import org.gradle.kotlin.dsl.named
2223
import org.gradle.kotlin.dsl.register
24+
import org.gradle.kotlin.dsl.withType
2325
import org.gradle.process.ExecResult
2426
import org.gradle.process.ExecSpec
2527
import org.gradle.tooling.BuildException
@@ -70,6 +72,7 @@ internal class KernelBuildConfigurator(private val project: Project) {
7072
apply("org.hildan.github.changelog")
7173
}
7274

75+
setupVersionsPlugin()
7376
setupKtLintForAllProjects()
7477

7578
println("##teamcity[buildNumber '${opts.pyPackageVersion}']")
@@ -115,11 +118,19 @@ internal class KernelBuildConfigurator(private val project: Project) {
115118
prepareJarTasks()
116119
}
117120

121+
private fun setupVersionsPlugin() {
122+
project.plugins.apply("com.github.ben-manes.versions")
123+
tasks.withType<DependencyUpdatesTask> {
124+
rejectVersionIf {
125+
isNonStableVersion(candidate.version) && !isNonStableVersion(currentVersion)
126+
}
127+
}
128+
}
129+
118130
private fun setupKtLintForAllProjects() {
119131
val ktlintVersion = project.defaultVersionCatalog.versions.ktlint
120132
project.allprojects {
121133
plugins.apply("org.jlleitschuh.gradle.ktlint")
122-
123134
extensions.configure<KtlintExtension> {
124135
version.set(ktlintVersion)
125136
enableExperimentalRules.set(true)

build-tools/build-plugin/src/build/util.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,7 @@ inline fun <reified T : Any> Project.getOrCreateExtension(extension: SingleInsta
150150
fun buildProperties(builderAction: MutableList<Pair<String, String>>.() -> Unit): List<Pair<String, String>> {
151151
return buildList(builderAction)
152152
}
153+
154+
fun isNonStableVersion(version: String): Boolean {
155+
return listOf("dev", "M", "alpha", "beta", "-").any { version.contains(it) }
156+
}

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Kotlin kernel for IPython/Jupyter
1010

11-
[Kotlin](https://kotlinlang.org/) (1.6.0-dev-1489) kernel for [Jupyter](https://jupyter.org).
11+
[Kotlin](https://kotlinlang.org/) (1.6.0-dev-1733) kernel for [Jupyter](https://jupyter.org).
1212

1313
Beta version. Tested with Jupyter Notebook 6.0.3, Jupyter Lab 1.2.6 and Jupyter Console 6.1.0
1414
on Windows, Ubuntu Linux and macOS.

gradle/libs.versions.toml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
[versions]
2-
kotlin = "1.6.0-dev-1489"
3-
stableKotlin = "1.5.20"
2+
kotlin = "1.6.0-dev-1733"
3+
stableKotlin = "1.5.21"
44
gradleKotlin = "1.4.31"
55
shadowJar = "7.0.0"
66
changelogPlugin = "1.7.0"
7-
kotlinxSerialization = "1.1.0"
8-
kotlinxCoroutines = "1.4.2"
7+
kotlinxSerialization = "1.2.2"
8+
kotlinxCoroutines = "1.5.1"
99
ktlintGradle = "10.0.0"
1010
ktlint = "0.40.0"
11-
publishPlugin = "0.0.52-dev"
11+
publishPlugin = "0.0.53-dev"
12+
versionsPlugin = "0.39.0"
1213

13-
slf4j = "1.7.30"
14-
logback = "1.2.3"
15-
http4k = "4.9.8.0"
16-
jupyterApi = "0.10.0-140"
17-
jetbrainsAnnotations = "20.1.0"
14+
slf4j = "1.7.32"
15+
logback = "1.2.4"
16+
http4k = "4.10.1.0"
17+
jupyterApi = "0.10.0-146"
18+
jetbrainsAnnotations = "21.0.1"
1819

19-
junit = "5.7.1"
20-
kotlinTest = "3.1.6"
20+
junit = "5.7.2"
21+
kotlinTest = "3.4.2"
2122
clikt = "2.8.0"
2223
zeromq = "0.5.2"
23-
gson = "2.8.6"
24+
gson = "2.8.7"
2425

2526
jlatexmath = "1.0.7"
2627
xmlgraphicsFop = "2.6"
@@ -125,6 +126,8 @@ plugin-publisher = { module = "ru.ileasile:kotlin-libs-publisher", version.ref =
125126
# id("org.hildan.github.changelog")
126127
plugin-changelog = { module = "gradle.plugin.org.hildan.gradle:gradle-github-changelog", version.ref = "changelogPlugin" }
127128

129+
# id("com.github.ben-manes.versions")
130+
plugin-versionsPlugin = { module = "com.github.ben-manes:gradle-versions-plugin", version.ref = "versionsPlugin" }
128131

129132
# Published artifacts of this project as binary dependencies
130133
jupyter-api = { group = "org.jetbrains.kotlinx", name = "kotlin-jupyter-api", version.ref = "jupyterApi" }
@@ -141,4 +144,5 @@ allGradlePlugins = [
141144
"plugin-ktlint",
142145
"plugin-publisher",
143146
"plugin-changelog",
147+
"plugin-versionsPlugin",
144148
]

jupyter-lib/kotlin-jupyter-api-gradle-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies {
2727

2828
val saveVersion by tasks.creating(CreateResourcesTask::class) {
2929
setupDependencies(tasks.processResources)
30-
addSingleValueFile("VERSION", rootSettings.pyPackageVersion)
30+
addSingleValueFile("VERSION", rootSettings.mavenVersion)
3131
}
3232

3333
java {

jupyter-lib/kotlin-jupyter-api-gradle-plugin/src/test/kotlin/org/jetbrains/kotlinx/jupyter/api/plugin/test/ResourcesTaskTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ class ResourcesTaskTests {
281281
}
282282

283283
companion object {
284-
private const val KOTLIN_VERSION = "1.5.20"
284+
private const val KOTLIN_VERSION = "1.5.21"
285285
private const val RESOURCES_TASK_NAME = "processResources"
286286
private const val JUPYTER_RESOURCES_TASK_NAME = "processJupyterApiResources"
287287

jupyter-lib/shared-compiler/build.gradle.kts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ buildSettings {
4444

4545
val buildProperties by tasks.creating(CreateResourcesTask::class) {
4646
setupDependencies(tasks.processResources)
47-
addPropertiesFile(
48-
"compiler.properties",
49-
mapOf(
50-
"version" to rootSettings.pyPackageVersion
51-
)
52-
)
47+
addPropertiesFile("compiler.properties", mapOf("version" to rootSettings.pyPackageVersion))
5348
}
5449

5550
kotlinPublications {

0 commit comments

Comments
 (0)