Skip to content

Commit bd15920

Browse files
authored
Merge pull request #147 from modelix/issue/MODELIX-465
MODELIX-465 Ordering of versions in the generated API Reference Landing Page is broken
2 parents c289c8d + 3955f6c commit bd15920

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import kotlinx.html.stream.createHTML
33
import org.jetbrains.dokka.base.DokkaBase
44
import org.jetbrains.dokka.base.DokkaBaseConfiguration
55
import org.jetbrains.dokka.gradle.DokkaTaskPartial
6+
import org.semver.Version
67

78
buildscript {
89
dependencies {
9-
classpath("org.jetbrains.dokka:versioning-plugin:1.8.10")
10+
classpath(libs.dokka.versioning)
11+
classpath(libs.semver)
1012
}
1113
}
1214

@@ -19,7 +21,7 @@ plugins {
1921
alias(libs.plugins.ktlint) apply false
2022
alias(libs.plugins.spotless) apply false
2123
alias(libs.plugins.tasktree)
22-
id("org.jetbrains.dokka") version "1.8.20"
24+
alias(libs.plugins.dokka)
2325
}
2426

2527
repositories {
@@ -44,7 +46,7 @@ fun computeVersion(): Any {
4446
}
4547

4648
dependencies {
47-
dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.8.10")
49+
dokkaPlugin(libs.dokka.versioning)
4850
}
4951

5052
subprojects {
@@ -204,7 +206,7 @@ fun createDocsIndexPage(): String {
204206
div("table") {
205207
val versionDirs = docsDir.listFiles()
206208
?.filter { it.isDirectory }
207-
?.sortedByDescending { it.name }
209+
?.sortedByDescending { Version.parse(it.name) }
208210
if (versionDirs != null) {
209211
for (versionDir in versionDirs) {
210212
val versionIndex = versionDir.resolve("index.html")

gradle/libs.versions.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "11.4.0" }
1515
spotless = { id = "com.diffplug.spotless", version = "6.18.0" }
1616
tasktree = { id = "com.dorongold.task-tree", version = "2.1.1" }
1717
modelix-mps-buildtools = { id = "org.modelix.mps.build-tools", version = "1.1.0" }
18+
dokka = {id = "org.jetbrains.dokka", version = "1.8.20"}
1819

1920
[versions]
2021
kotlin = "1.8.22"
@@ -82,3 +83,6 @@ junit = { group = "junit", name = "junit", version = "4.13.2" }
8283

8384
apache-cxf-sse = { group = "org.apache.cxf", name = "cxf-rt-rs-sse", version.ref = "apacheCxf" }
8485
apache-cxf-client = { group = "org.apache.cxf", name = "cxf-rt-rs-client", version.ref = "apacheCxf" }
86+
87+
semver = { group = "org.semver", name = "api", version = "0.9.33"}
88+
dokka-versioning = { group = "org.jetbrains.dokka", name = "versioning-plugin", version = "1.8.20"}

0 commit comments

Comments
 (0)