Skip to content

Commit 05260ef

Browse files
Dokka: Solve problem with <Error class: unknown class>.
1 parent e6a23c7 commit 05260ef

File tree

4 files changed

+69
-50
lines changed

4 files changed

+69
-50
lines changed

build.gradle.kts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ if (project.file("local.properties").exists()) {
3636

3737
allprojects {
3838
group = "org.jetbrains.lets-plot"
39-
version = when (name) {
40-
"dokka" -> "4.11.0"
41-
else -> "4.11.1-SNAPSHOT"
42-
// else -> "0.0.0-SNAPSHOT" // for local publishing only
43-
}
39+
version = "4.11.1-SNAPSHOT"
40+
// version = "0.0.0-SNAPSHOT" // for local publishing only
4441

4542
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
4643
kotlinOptions {

devdocs/RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This is optional: needed only if a newer version of 'kotlin-jupyter-kernel' is r
8282
8383
##### Set Release Version
8484

85-
- In [build.gradle.kts](../build.gradle.kts) update:`"dokka" -> <version>`
85+
- In [build.gradle.kts](../docs/dokka/build.gradle.kts) update `libVersion` for the Dokka.
8686

8787
- In [v.list](../Writerside/v.list) update `version` for the Writerside.
8888
Check the values of `current_year` and `web_root`.

docs/dokka/build.gradle.kts

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,58 @@
33
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
44
*/
55

6+
import org.jetbrains.dokka.gradle.DokkaTask
67
import java.time.LocalDateTime
78

89
plugins {
910
id("org.jetbrains.dokka")
1011
}
1112

12-
val rootDir = rootProject.projectDir.toString().replace("\\", "/")
13-
val docsDir = "$rootDir/docs"
14-
val buildDir = "$docsDir/build"
15-
val dokkaDir = projectDir.toString().replace("\\", "/")
16-
val dokkaSrcDir = "$dokkaDir/source"
13+
val libVersion = "4.11.0"
14+
15+
val rootDirectory = rootProject.projectDir.toString().replace("\\", "/")
16+
val docsDirectory = "$rootDirectory/docs"
17+
val dokkaDirectory = projectDir.toString().replace("\\", "/")
18+
val dokkaSrcDirectory = "$dokkaDirectory/source"
1719

1820
val gitHubLink = "https://github.com/JetBrains/lets-plot-kotlin"
1921
val customFooterMessage = "Copyright © 2019-${LocalDateTime.now().year} JetBrains s.r.o."
20-
val customStyleSheet = "$dokkaSrcDir/custom.css"
21-
val customScript = "$dokkaSrcDir/custom.js"
22-
val logoLightImage = "$docsDir/images/logo-icon.svg"
23-
val logoDarkImage = "$docsDir/images/logo-dark.svg"
24-
val gitHubImage = "$docsDir/images/homepage.svg"
25-
26-
tasks.dokkaHtml {
27-
moduleName.set("Lets-Plot-Kotlin")
28-
outputDirectory.set(File("$buildDir/api-reference"))
29-
pluginsMapConfiguration.set(
30-
mapOf(
31-
"org.jetbrains.dokka.base.DokkaBase" to """{
32-
|"customAssets": ["$customScript", "$logoLightImage", "$logoDarkImage", "$gitHubImage"],
33-
|"customStyleSheets": ["$customStyleSheet"],
34-
|"homepageLink": "$gitHubLink",
35-
|"footerMessage": "$customFooterMessage"
36-
|}""".trimMargin()
22+
val customStyleSheet = "$dokkaSrcDirectory/custom.css"
23+
val customScript = "$dokkaSrcDirectory/custom.js"
24+
val logoLightImage = "$docsDirectory/images/logo-icon.svg"
25+
val logoDarkImage = "$docsDirectory/images/logo-dark.svg"
26+
val gitHubImage = "$docsDirectory/images/homepage.svg"
27+
28+
evaluationDependsOn(":plot-api")
29+
30+
rootProject.project(":plot-api")
31+
.tasks.named<DokkaTask>("dokkaHtml")
32+
.configure {
33+
moduleName.set("Lets-Plot-Kotlin")
34+
outputDirectory.set(File("$docsDirectory/build/api-reference"))
35+
pluginsMapConfiguration.set(
36+
mapOf(
37+
"org.jetbrains.dokka.base.DokkaBase" to """
38+
{
39+
"homepageLink": "$gitHubLink",
40+
"footerMessage": "$customFooterMessage",
41+
"customAssets": [
42+
"$customScript",
43+
"$logoLightImage",
44+
"$logoDarkImage",
45+
"$gitHubImage"
46+
],
47+
"customStyleSheets": [
48+
"$customStyleSheet"
49+
]
50+
}
51+
""".trimIndent()
52+
)
3753
)
38-
)
39-
dokkaSourceSets {
40-
configureEach {
41-
skipDeprecated.set(true)
42-
includes.from("$dokkaSrcDir/packages.md")
43-
perPackageOption {
44-
matchingRegex.set(""".*\.frontend.*""")
45-
suppress.set(true)
46-
}
47-
perPackageOption {
48-
matchingRegex.set(""".*\.intern.*""")
49-
suppress.set(true)
50-
}
51-
perPackageOption {
52-
matchingRegex.set(""".*\.intern\.layer.*""")
53-
suppress.set(false)
54-
}
55-
}
56-
register("plotAPI") {
57-
displayName.set("Plot API")
58-
sourceRoots.from("$rootDir/plot-api/src/commonMain", "$rootDir/plot-api/src/jvmMain")
59-
}
54+
}
55+
56+
gradle.taskGraph.whenReady {
57+
if (hasTask(":plot-api:dokkaHtml")) {
58+
rootProject.project(":plot-api").version = libVersion
6059
}
6160
}

plot-api/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
plugins {
77
kotlin("multiplatform")
8+
id("org.jetbrains.dokka")
89
`maven-publish`
910
signing
1011
}
@@ -73,6 +74,28 @@ kotlin {
7374
}
7475
}
7576

77+
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
78+
dokkaSourceSets.configureEach {
79+
skipDeprecated.set(true)
80+
includes.from("${rootProject.projectDir}/docs/dokka/source/packages.md")
81+
82+
perPackageOption {
83+
matchingRegex.set(""".*\.frontend.*""")
84+
suppress.set(true)
85+
}
86+
perPackageOption {
87+
matchingRegex.set(""".*\.intern.*""")
88+
suppress.set(true)
89+
}
90+
perPackageOption {
91+
matchingRegex.set(""".*\.intern\.layer.*""")
92+
suppress.set(false)
93+
}
94+
}
95+
96+
dokkaSourceSets.named("commonMain") { displayName.set("Plot API") }
97+
}
98+
7699

77100
val artifactBaseName = "lets-plot-kotlin"
78101
val artifactGroupId = project.group as String

0 commit comments

Comments
 (0)